summaryrefslogtreecommitdiffstats
path: root/usr.sbin/usbd/usbd.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-12-06 14:50:41 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-12-06 14:50:41 +0000
commitec77c8ed3330a9d2f21fbecb3d2e0d35ef038c13 (patch)
treedc4eec41ba5d549313db3d78b122b01d5a2fd6a7 /usr.sbin/usbd/usbd.c
parent83c2cea457cac2b346ef3a30ddfdaaa5a9115e2d (diff)
downloadFreeBSD-src-ec77c8ed3330a9d2f21fbecb3d2e0d35ef038c13.zip
FreeBSD-src-ec77c8ed3330a9d2f21fbecb3d2e0d35ef038c13.tar.gz
Complain if we get an error that is not ENXIO while opening /dev/usb\d+
devices. For example, starting 'usbd -e' would give a 'No USB controllers found' message instead of a '/dev/usb0: Permission denied'. Submitted-By: Dirk-Willem van Gulik <dirkx@webweaving.org>
Diffstat (limited to 'usr.sbin/usbd/usbd.c')
-rw-r--r--usr.sbin/usbd/usbd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c
index 3cc157e..b5fda98 100644
--- a/usr.sbin/usbd/usbd.c
+++ b/usr.sbin/usbd/usbd.c
@@ -942,6 +942,13 @@ main(int argc, char **argv)
if (fds[ndevs] > maxfd)
maxfd = fds[ndevs];
ndevs++;
+ } else if (errno != ENXIO) {
+ /* there was an error, on a device that does
+ * exist (device is configured)
+ */
+ fprintf(stderr, "%s: Could not open %s, %s\n",
+ __progname, buf, strerror(errno));
+ exit(1);
}
}
} else {
OpenPOWER on IntegriCloud