Module Name:    src
Committed By:   pgoyette
Date:           Fri Nov 20 00:40:18 UTC 2015

Modified Files:
        src/share/man/man4: filemon.4

Log Message:
Minor cleanup in example code - use FD_CLOEXEC instead of magic number


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man4/filemon.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/filemon.4
diff -u src/share/man/man4/filemon.4:1.8 src/share/man/man4/filemon.4:1.9
--- src/share/man/man4/filemon.4:1.8	Sat Apr 21 12:27:28 2012
+++ src/share/man/man4/filemon.4	Fri Nov 20 00:40:18 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: filemon.4,v 1.8 2012/04/21 12:27:28 roy Exp $
+.\"	$NetBSD: filemon.4,v 1.9 2015/11/20 00:40:18 pgoyette Exp $
 .\"
 .\" Copyright (c) 2011, Juniper Networks, Inc.
 .\"
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 .\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 5, 2012
+.Dd November 20, 2015
 .Dt FILEMON 4
 .Os
 .Sh NAME
@@ -150,8 +150,8 @@ temp_fd = mkstemp("/tmp/filemon.XXXXXXX"
 /* give filemon the temp file to use */
 ioctl(filemon_fd, FILEMON_SET_FD, &temp_fd);
 /* children do not need these once they exec */
-fcntl(filemon_fd, F_SETFD, 1);
-fcntl(temp_fd, F_SETFD, 1);
+fcntl(filemon_fd, F_SETFD, FD_CLOEXEC);
+fcntl(temp_fd, F_SETFD, FD_CLOEXEC);
 
 pid = fork();
 switch(pid) {

Reply via email to