diff --git a/usr.bin/usbhidctl/Makefile b/usr.bin/usbhidctl/Makefile index 7fd19b0547fb..b12182c580e5 100644 --- a/usr.bin/usbhidctl/Makefile +++ b/usr.bin/usbhidctl/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.4 1999/05/11 21:02:25 augustss Exp $ +# $NetBSD: Makefile,v 1.5 2001/12/22 12:34:41 augustss Exp $ .include PROG= usbhidctl SRCS= usbhid.c -LDADD+= -lusb +LDADD+= -lusbhid DPADD+= ${LIBUSB} .include diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c index 132be2bf2855..49436528ee01 100644 --- a/usr.bin/usbhidctl/usbhid.c +++ b/usr.bin/usbhidctl/usbhid.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbhid.c,v 1.18 2001/10/22 22:03:49 augustss Exp $ */ +/* $NetBSD: usbhid.c,v 1.19 2001/12/22 12:34:41 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -570,9 +570,11 @@ devloop(int hidfd, report_desc_t rd, struct Susbvar *varlist, size_t vlsize) ssize_t readlen; readlen = read(hidfd, dbuf, dlen); - if (readlen < 0 || dlen != (size_t)readlen) - err(1, "bad read %ld != %ld", - (long)readlen, (long)dlen); + if (readlen < 0) + err(1, "Device read error"); + if (dlen != (size_t)readlen) + errx(1, "Unexpected response length: %lu != %lu", + (unsigned long)readlen, (unsigned long)dlen); collind = 0; hdata = hid_start_parse(rd, 1 << hid_input);