Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make/filemon filemon_dev:filemon_open need FD_CLOEXEC



details:   https://anonhg.NetBSD.org/src/rev/7afc4258c743
branches:  trunk
changeset: 1011764:7afc4258c743
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Jul 10 00:42:53 2020 +0000

description:
filemon_dev:filemon_open need FD_CLOEXEC

We need to mark the fd for filemon FD_CLOEXEC
so that when we call filemon_close() the device is
closed and unflushed data written to our temp file.

diffstat:

 usr.bin/make/filemon/filemon_dev.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r ff85e4804afc -r 7afc4258c743 usr.bin/make/filemon/filemon_dev.c
--- a/usr.bin/make/filemon/filemon_dev.c        Thu Jul 09 23:43:41 2020 +0000
+++ b/usr.bin/make/filemon/filemon_dev.c        Fri Jul 10 00:42:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filemon_dev.c,v 1.1 2020/01/19 19:49:37 riastradh Exp $        */
+/*     $NetBSD: filemon_dev.c,v 1.2 2020/07/10 00:42:53 sjg Exp $      */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -76,6 +76,7 @@
                        goto fail0;
                }
        }
+       (void)fcntl(F->fd, F_SETFD, FD_CLOEXEC);
 
        /* Success!  */
        return F;



Home | Main Index | Thread Index | Old Index