Source-Changes-HG archive

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

[src/netbsd-3]: src/usr.bin/sockstat Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/82095573dfa0
branches:  netbsd-3
changeset: 577313:82095573dfa0
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Oct 06 11:36:37 2005 +0000

description:
Pull up following revision(s) (requested by rpaulo in ticket #860):
        usr.bin/sockstat/sockstat.c: revision 1.10
If the specificed MIB doesn't exist, then it's probably a kernel without
that socket type (AF_INET, AF_INET6, etc.). That's a normal condition, so
don't bail out.
Reviewed by Andrew Brown.

diffstat:

 usr.bin/sockstat/sockstat.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r b3a349ea7d52 -r 82095573dfa0 usr.bin/sockstat/sockstat.c
--- a/usr.bin/sockstat/sockstat.c       Thu Oct 06 11:36:28 2005 +0000
+++ b/usr.bin/sockstat/sockstat.c       Thu Oct 06 11:36:37 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sockstat.c,v 1.4.2.5 2005/10/06 11:36:28 tron Exp $ */
+/*     $NetBSD: sockstat.c,v 1.4.2.6 2005/10/06 11:36:37 tron Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: sockstat.c,v 1.4.2.5 2005/10/06 11:36:28 tron Exp $");
+__RCSID("$NetBSD: sockstat.c,v 1.4.2.6 2005/10/06 11:36:37 tron Exp $");
 #endif
 
 #include <sys/param.h>
@@ -290,8 +290,11 @@
 
        sz = CTL_MAXNAME;
        rc = sysctlnametomib(mib, &name[0], &sz);
-       if (rc == -1)
+       if (rc == -1) {
+               if (errno == ENOENT)
+                       return;
                err(1, "sysctlnametomib: %s", mib);
+       }
        namelen = sz;
 
        name[namelen++] = PCB_ALL;



Home | Main Index | Thread Index | Old Index