Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/usbdevs Make output a little less confusing if run ...



details:   https://anonhg.NetBSD.org/src/rev/0df03829dc53
branches:  trunk
changeset: 476150:0df03829dc53
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Sep 08 02:39:36 1999 +0000

description:
Make output a little less confusing if run without root priviliges.
>From "Soren S. Jorvang" <soren%wheel.dk@localhost>

diffstat:

 usr.sbin/usbdevs/usbdevs.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r b766ef53ceed -r 0df03829dc53 usr.sbin/usbdevs/usbdevs.c
--- a/usr.sbin/usbdevs/usbdevs.c        Wed Sep 08 02:01:55 1999 +0000
+++ b/usr.sbin/usbdevs/usbdevs.c        Wed Sep 08 02:39:36 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdevs.c,v 1.10 1999/06/30 06:23:28 augustss Exp $    */
+/*     $NetBSD: usbdevs.c,v 1.11 1999/09/08 02:39:36 augustss Exp $    */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -198,13 +198,14 @@
                        sprintf(buf, "%s%d", USBDEV, i);
                        f = open(buf, O_RDONLY);
                        if (f >= 0) {
-                               ncont++;
                                dumpone(buf, f, addr);
                                close(f);
                        } else {
-                               if (errno == EACCES)
-                                       warn("%s", buf);
+                               if (errno == ENOENT || errno == ENXIO)
+                                       continue;
+                               warn("%s", buf);
                        }
+                       ncont++;
                }
                if (verbose && ncont == 0)
                        printf("%s: no USB controllers found\n", __progname);



Home | Main Index | Thread Index | Old Index