diff options
author | 2007-09-29 09:47:23 +0000 | |
---|---|---|
committer | 2007-09-29 09:47:23 +0000 | |
commit | f1a16489dbf1cdad709158c43ef6ec67ccccbe31 (patch) | |
tree | f43b8be0f8d1649a910c2604895172a820b5c771 | |
parent | remove comment that no longer apply. (diff) | |
download | wireguard-openbsd-f1a16489dbf1cdad709158c43ef6ec67ccccbe31.tar.xz wireguard-openbsd-f1a16489dbf1cdad709158c43ef6ec67ccccbe31.zip |
use constant FD_CLOEXEC, more readable than 1.
zap comment that should have gone with setting use_pipes.
-rw-r--r-- | usr.bin/make/job.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index e4b62c25846..20fd3e3240d 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: job.c,v 1.89 2007/09/29 09:02:05 espie Exp $ */ +/* $OpenBSD: job.c,v 1.90 2007/09/29 09:47:23 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -1237,7 +1237,7 @@ JobStart(GNode *gn, /* target to create */ if (job->cmdFILE == NULL) { Punt("Error creating command file"); } - (void)fcntl(fileno(job->cmdFILE), F_SETFD, 1); + (void)fcntl(fileno(job->cmdFILE), F_SETFD, FD_CLOEXEC); /* * Send the commands to the command file, flush all its buffers * then rewind and remove the thing. @@ -1337,17 +1337,14 @@ JobStart(GNode *gn, /* target to create */ */ JobMakeArgv(job, argv); - /* - * If we're using pipes to catch output, create the pipe by which we'll - * get the shell's output. If we're using files, print out that we're - * starting a job and then set up its temporary-file name. + /* Create the pipe by which we'll get the shell's output. */ if (pipe(fd) == -1) Punt("Cannot create pipe: %s", strerror(errno)); job->inPipe = fd[0]; job->outPipe = fd[1]; - (void)fcntl(job->inPipe, F_SETFD, 1); - (void)fcntl(job->outPipe, F_SETFD, 1); + (void)fcntl(job->inPipe, F_SETFD, FD_CLOEXEC); + (void)fcntl(job->outPipe, F_SETFD, FD_CLOEXEC); if (nJobs >= maxJobs && !(job->flags & JOB_SPECIAL) && maxJobs != 0) { |