[master] 7340726 Also use VSUB_closefrom() here.

Poul-Henning Kamp phk at FreeBSD.org
Wed Jan 6 14:51:54 CET 2016


commit 7340726504ef92a6fcc415c8d8830708f0152acb
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