Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm actually do the close-on-exec



details:   https://anonhg.NetBSD.org/src/rev/f9e01dd24d7f
branches:  trunk
changeset: 536510:f9e01dd24d7f
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Sep 17 19:38:26 2002 +0000

description:
actually do the close-on-exec

diffstat:

 lib/libkvm/kvm.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 2ff384ca3f71 -r f9e01dd24d7f lib/libkvm/kvm.c
--- a/lib/libkvm/kvm.c  Tue Sep 17 18:42:59 2002 +0000
+++ b/lib/libkvm/kvm.c  Tue Sep 17 19:38:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm.c,v 1.73 2002/09/16 17:20:45 christos Exp $        */
+/*     $NetBSD: kvm.c,v 1.74 2002/09/17 19:38:26 drochner Exp $        */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm.c      8.2 (Berkeley) 2/13/94";
 #else
-__RCSID("$NetBSD: kvm.c,v 1.73 2002/09/16 17:20:45 christos Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.74 2002/09/17 19:38:26 drochner Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -159,9 +159,7 @@
 
        if ((fd = open(fname, flags, mode)) == -1)
                return fd;
-       if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
-               goto error;
-       if (fcntl(fd, F_SETFL, flags | 1) == -1)
+       if (fcntl(fd, F_SETFD, (void *)1) == -1)
                goto error;
 
        return fd;



Home | Main Index | Thread Index | Old Index