Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Use FD_CLOEXEC (Tilman Sauerbeck)



details:   https://anonhg.NetBSD.org/src/rev/27ec8130985e
branches:  trunk
changeset: 813135:27ec8130985e
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 17 15:30:23 2016 +0000

description:
Use FD_CLOEXEC (Tilman Sauerbeck)

diffstat:

 usr.bin/make/job.c  |  16 ++++++++--------
 usr.bin/make/meta.c |  10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diffs (88 lines):

diff -r b6d307931c4d -r 27ec8130985e usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Jan 17 15:08:10 2016 +0000
+++ b/usr.bin/make/job.c        Sun Jan 17 15:30:23 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $       */
+/*     $NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -412,8 +412,8 @@
     }
     
     /* Set close-on-exec flag for both */
-    (void)fcntl(job->jobPipe[0], F_SETFD, 1);
-    (void)fcntl(job->jobPipe[1], F_SETFD, 1);
+    (void)fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC);
+    (void)fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC);
 
     /*
      * We mark the input side of the pipe non-blocking; we poll(2) the
@@ -1582,7 +1582,7 @@
        if (job->cmdFILE == NULL) {
            Punt("Could not fdopen %s", tfile);
        }
-       (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.
@@ -2835,8 +2835,8 @@
        /* Pipe passed in from parent */
        tokenWaitJob.inPipe = jp_0;
        tokenWaitJob.outPipe = jp_1;
-       (void)fcntl(jp_0, F_SETFD, 1);
-       (void)fcntl(jp_1, F_SETFD, 1);
+       (void)fcntl(jp_0, F_SETFD, FD_CLOEXEC);
+       (void)fcntl(jp_1, F_SETFD, FD_CLOEXEC);
        return;
     }
 
diff -r b6d307931c4d -r 27ec8130985e usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Sun Jan 17 15:08:10 2016 +0000
+++ b/usr.bin/make/meta.c       Sun Jan 17 15:30:23 2016 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.41 2015/11/30 23:37:56 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.42 2016/01/17 15:30:23 christos Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -144,8 +144,8 @@
        err(1, "Could not set filemon file descriptor!");
     }
     /* we don't need these once we exec */
-    (void)fcntl(pbm->mon_fd, F_SETFD, 1);
-    (void)fcntl(pbm->filemon_fd, F_SETFD, 1);
+    (void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC);
+    (void)fcntl(pbm->filemon_fd, F_SETFD, FD_CLOEXEC);
 }
 
 /*
@@ -1423,8 +1423,8 @@
     if (pipe(childPipe) < 0)
        Punt("Cannot create pipe: %s", strerror(errno));
     /* Set close-on-exec flag for both */
-    (void)fcntl(childPipe[0], F_SETFD, 1);
-    (void)fcntl(childPipe[1], F_SETFD, 1);
+    (void)fcntl(childPipe[0], F_SETFD, FD_CLOEXEC);
+    (void)fcntl(childPipe[1], F_SETFD, FD_CLOEXEC);
 }
 
 void



Home | Main Index | Thread Index | Old Index