Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Close child's reference to meta file.



details:   https://anonhg.NetBSD.org/src/rev/93af546bef1d
branches:  trunk
changeset: 807216:93af546bef1d
user:      sjg <sjg%NetBSD.org@localhost>
date:      Wed Apr 01 01:03:55 2015 +0000

description:
Close child's reference to meta file.

diffstat:

 usr.bin/make/meta.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r 22eb0b2e76f3 -r 93af546bef1d usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Tue Mar 31 22:00:53 2015 +0000
+++ b/usr.bin/make/meta.c       Wed Apr 01 01:03:55 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.36 2014/11/06 01:36:57 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.37 2015/04/01 01:03:55 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -659,17 +659,21 @@
 {
 #ifdef USE_FILEMON
     BuildMon *pbm;
-    pid_t pid;
 
     if (job != NULL) {
        pbm = &job->bm;
     } else {
        pbm = &Mybm;
     }
-    pid = getpid();
-    if (pbm->mfp != NULL && useFilemon) {
-       if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) {
-           err(1, "Could not set filemon pid!");
+    if (pbm->mfp != NULL) {
+       close(fileno(pbm->mfp));
+       if (useFilemon) {
+           pid_t pid;
+
+           pid = getpid();
+           if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) {
+               err(1, "Could not set filemon pid!");
+           }
        }
     }
 #endif



Home | Main Index | Thread Index | Old Index