summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ugen.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-07-02 22:20:09 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-07-02 22:20:09 +0000
commitb465f3e780026bbb1f86ec7a6203a06672328984 (patch)
treed469d9b497adf66bfe8e193b90c248fdbe819588 /sys/dev/usb/ugen.c
parent97d8260479f882ea93b1225536948b7ce658b9dd (diff)
kqueue attach functions should return an errno or 0, not a plain 1. Fix
the obvious cases to return EINVAL and ENXIO. ok tedu deraadt
Diffstat (limited to 'sys/dev/usb/ugen.c')
-rw-r--r--sys/dev/usb/ugen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index aa9c673e2cf..8ed3dd5610b 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.64 2011/01/25 20:03:36 jakemsr Exp $ */
+/* $OpenBSD: ugen.c,v 1.65 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -1406,12 +1406,12 @@ ugenkqfilter(dev_t dev, struct knote *kn)
sc = ugen_cd.cd_devs[UGENUNIT(dev)];
if (sc->sc_dying)
- return (1);
+ return (ENXIO);
/* XXX always IN */
sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
if (sce == NULL)
- return (1);
+ return (EINVAL);
switch (kn->kn_filter) {
case EVFILT_READ:
@@ -1432,7 +1432,7 @@ ugenkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &ugen_seltrue_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
break;
@@ -1442,7 +1442,7 @@ ugenkqfilter(dev_t dev, struct knote *kn)
case UE_INTERRUPT:
case UE_ISOCHRONOUS:
/* XXX poll doesn't support this */
- return (1);
+ return (EINVAL);
case UE_BULK:
/*
@@ -1453,12 +1453,12 @@ ugenkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &ugen_seltrue_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (void *)sce;