Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm as swap is now optional, ENXIO on /dev/drum is no...



details:   https://anonhg.NetBSD.org/src/rev/af0f15cc465c
branches:  trunk
changeset: 583329:af0f15cc465c
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Jul 30 16:32:29 2005 +0000

description:
as swap is now optional, ENXIO on /dev/drum is normal.

diffstat:

 lib/libkvm/kvm.c      |  11 +++++++----
 lib/libkvm/kvm_proc.c |   7 ++++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (60 lines):

diff -r 179a0c38cd5a -r af0f15cc465c lib/libkvm/kvm.c
--- a/lib/libkvm/kvm.c  Sat Jul 30 16:19:09 2005 +0000
+++ b/lib/libkvm/kvm.c  Sat Jul 30 16:32:29 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm.c,v 1.83 2004/02/13 11:36:08 wiz Exp $     */
+/*     $NetBSD: kvm.c,v 1.84 2005/07/30 16:32:29 yamt Exp $    */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm.c      8.2 (Berkeley) 2/13/94";
 #else
-__RCSID("$NetBSD: kvm.c,v 1.83 2004/02/13 11:36:08 wiz Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.84 2005/07/30 16:32:29 yamt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -323,8 +323,11 @@
                }
                kd->alive = KVM_ALIVE_FILES;
                if ((kd->swfd = open_cloexec(sf, flag, 0)) < 0) {
-                       _kvm_syserr(kd, kd->program, "%s", sf);
-                       goto failed;
+                       if (errno != ENXIO) {
+                               _kvm_syserr(kd, kd->program, "%s", sf);
+                               goto failed;
+                       }
+                       /* swap is not configured?  not fatal */
                }
                /*
                 * Open the kernel namelist.  If /dev/ksyms doesn't 
diff -r 179a0c38cd5a -r af0f15cc465c lib/libkvm/kvm_proc.c
--- a/lib/libkvm/kvm_proc.c     Sat Jul 30 16:19:09 2005 +0000
+++ b/lib/libkvm/kvm_proc.c     Sat Jul 30 16:32:29 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm_proc.c,v 1.59 2005/05/11 17:41:52 jmc Exp $        */
+/*     $NetBSD: kvm_proc.c,v 1.60 2005/07/30 16:32:29 yamt Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
 #else
-__RCSID("$NetBSD: kvm_proc.c,v 1.59 2005/05/11 17:41:52 jmc Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.60 2005/07/30 16:32:29 yamt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -251,7 +251,8 @@
                    (off_t)pg.phys_addr) != kd->nbpg)
                        return (NULL);
        } else {
-               if (pread(kd->swfd, kd->swapspc, (size_t)kd->nbpg,
+               if (kd->swfd < 0 ||
+                   pread(kd->swfd, kd->swapspc, (size_t)kd->nbpg,
                    (off_t)(anon.an_swslot * kd->nbpg)) != kd->nbpg)
                        return (NULL);
        }



Home | Main Index | Thread Index | Old Index