Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/usbdevs Improve messages in case of error.



details:   https://anonhg.NetBSD.org/src/rev/3be6adc28389
branches:  trunk
changeset: 474162:3be6adc28389
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Jun 30 06:23:28 1999 +0000

description:
Improve messages in case of error.

diffstat:

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

diffs (37 lines):

diff -r cf0a1642bf6c -r 3be6adc28389 usr.sbin/usbdevs/usbdevs.c
--- a/usr.sbin/usbdevs/usbdevs.c        Wed Jun 30 06:21:21 1999 +0000
+++ b/usr.sbin/usbdevs/usbdevs.c        Wed Jun 30 06:23:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdevs.c,v 1.9 1999/05/16 18:00:35 tron Exp $ */
+/*     $NetBSD: usbdevs.c,v 1.10 1999/06/30 06:23:28 augustss Exp $    */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -79,10 +79,13 @@
 
        di.addr = a;
        e = ioctl(f, USB_DEVICEINFO, &di);
-       if (e)
+       if (e) {
+               if (errno != ENXIO)
+                       printf("addr %d: I/O error\n", a);
                return;
+       }
+       printf("addr %d: ", a);
        done[a] = 1;
-       printf("addr %d: ", di.addr);
        if (verbose) {
                if (di.lowspeed)
                        printf("low speed, ");
@@ -122,7 +125,10 @@
                printf("%*s", indent, "");
                if (verbose)
                        printf("port %d ", p+1);
-               usbdev(f, di.ports[p], 1);
+               if (s == 0)
+                       printf("addr 0 should never happen!\n");
+               else
+                       usbdev(f, s, 1);
                indent--;
        }
 }



Home | Main Index | Thread Index | Old Index