Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm another SETFL->SETFD



details:   https://anonhg.NetBSD.org/src/rev/6e7b94e728b1
branches:  trunk
changeset: 536511:6e7b94e728b1
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Sep 17 19:50:48 2002 +0000

description:
another SETFL->SETFD

diffstat:

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

diffs (38 lines):

diff -r f9e01dd24d7f -r 6e7b94e728b1 lib/libkvm/kvm.c
--- a/lib/libkvm/kvm.c  Tue Sep 17 19:38:26 2002 +0000
+++ b/lib/libkvm/kvm.c  Tue Sep 17 19:50:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm.c,v 1.74 2002/09/17 19:38:26 drochner Exp $        */
+/*     $NetBSD: kvm.c,v 1.75 2002/09/17 19:50:48 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.74 2002/09/17 19:38:26 drochner Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.75 2002/09/17 19:50:48 drochner Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -723,17 +723,13 @@
        struct nlist nitem;
        char dbversion[_POSIX2_LINE_MAX];
        char kversion[_POSIX2_LINE_MAX];
-       int fd, flags;
+       int fd;
 
        kd->db = dbopen(_PATH_KVMDB, O_RDONLY, 0, DB_HASH, NULL);
        if (kd->db == 0)
                return (-1);
        if ((fd = (*kd->db->fd)(kd->db)) >= 0) {
-               if ((flags = fcntl(fd, F_GETFL, 0)) == -1) {
-                      (*kd->db->close)(kd->db);
-                      return (-1);
-               }
-               if (fcntl(fd, F_SETFL, flags | 1) == -1) {
+               if (fcntl(fd, F_SETFD, (void *)1) == -1) {
                       (*kd->db->close)(kd->db);
                       return (-1);
                }



Home | Main Index | Thread Index | Old Index