[4.1] e821059 Also use VSUB_closefrom() here.

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 14 15:15:11 CET 2016


commit e8210595c9b030a8577a5f0e1385b9fa1f76ec92
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jan 6 13:51:39 2016 +0000

    Also use VSUB_closefrom() here.

diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 500f0ae..77d8715 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -49,6 +49,7 @@
 #include "vapi/vsm.h"
 #include "vcli.h"
 #include "vss.h"
+#include "vsub.h"
 #include "vtcp.h"
 #include "vtim.h"
 
@@ -434,8 +435,7 @@ varnish_launch(struct varnish *v)
 		AZ(close(v->fds[1]));
 		AZ(close(v->fds[2]));
 		AZ(close(v->fds[3]));
-		for (i = 3; i <getdtablesize(); i++)
-			(void)close(i);
+		VSUB_closefrom(STDERR_FILENO + 1);
 		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(vsb), (char*)0));
 		exit(1);
 	} else {



More information about the varnish-commit mailing list