[master] 97a02d2 Use VSUB_closefrom()
Poul-Henning Kamp
phk at FreeBSD.org
Wed Jan 6 14:51:54 CET 2016
commit 97a02d2e60f4238ed177ff9cb416804a3b920bab
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Jan 6 13:48:58 2016 +0000
Use VSUB_closefrom()
diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 8770b5f..f63c2e5 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -42,6 +42,7 @@
#include <unistd.h>
#include "vtc.h"
+#include "vsub.h"
struct process {
unsigned magic;
@@ -183,7 +184,7 @@ static void
process_start(struct process *p)
{
struct vsb *cl;
- int i, out_fd, err_fd;
+ int out_fd, err_fd;
CHECK_OBJ_NOTNULL(p, PROCESS_MAGIC);
@@ -203,8 +204,7 @@ process_start(struct process *p)
assert(dup2(p->fds[0], 0) == 0);
assert(dup2(out_fd, 1) == 1);
assert(dup2(err_fd, 2) == 2);
- for (i = sysconf(_SC_OPEN_MAX); i > STDERR_FILENO; i--)
- (void)close(i);
+ VSUB_closefrom(STDERR_FILENO + 1);
AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(cl), (char*)0));
exit(1);
}
More information about the varnish-commit
mailing list