Commit c1f80131 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Another use for VSUB_closefrom()

parent 55dc8fd4
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "vrnd.h" #include "vrnd.h"
#include "vsa.h" #include "vsa.h"
#include "vss.h" #include "vss.h"
#include "vsub.h"
#include "vtcp.h" #include "vtcp.h"
#include "vtim.h" #include "vtim.h"
...@@ -232,7 +233,7 @@ static void ...@@ -232,7 +233,7 @@ static void
start_test(void) start_test(void)
{ {
struct vtc_tst *tp; struct vtc_tst *tp;
int p[2], sfd, retval; int p[2], retval;
struct vtc_job *jp; struct vtc_job *jp;
char tmpdir[PATH_MAX]; char tmpdir[PATH_MAX];
...@@ -274,8 +275,7 @@ start_test(void) ...@@ -274,8 +275,7 @@ start_test(void)
assert(open("/dev/null", O_RDONLY) == STDIN_FILENO); assert(open("/dev/null", O_RDONLY) == STDIN_FILENO);
assert(dup2(p[1], STDOUT_FILENO) == STDOUT_FILENO); assert(dup2(p[1], STDOUT_FILENO) == STDOUT_FILENO);
assert(dup2(p[1], STDERR_FILENO) == STDERR_FILENO); assert(dup2(p[1], STDERR_FILENO) == STDERR_FILENO);
for (sfd = STDERR_FILENO + 1; sfd < 100; sfd++) VSUB_closefrom(STDERR_FILENO + 1);
(void)close(sfd);
retval = exec_file(jp->tst->filename, jp->tst->script, retval = exec_file(jp->tst->filename, jp->tst->script,
jp->tmpdir, jp->buf, jp->bufsiz); jp->tmpdir, jp->buf, jp->bufsiz);
exit(retval); exit(retval);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment