summaryrefslogtreecommitdiff
path: root/sys/dev
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
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')
-rw-r--r--sys/dev/acpi/acpi.c6
-rw-r--r--sys/dev/audio.c4
-rw-r--r--sys/dev/cons.c6
-rw-r--r--sys/dev/hotplug.c4
-rw-r--r--sys/dev/midi.c4
-rw-r--r--sys/dev/sequencer.c4
-rw-r--r--sys/dev/usb/ugen.c14
-rw-r--r--sys/dev/usb/uhid.c4
-rw-r--r--sys/dev/usb/uscanner.c6
-rw-r--r--sys/dev/vscsi.c4
10 files changed, 28 insertions, 28 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 231f34b3f83..c8bd966430f 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.226 2011/06/24 19:47:49 naddy Exp $ */
+/* $OpenBSD: acpi.c,v 1.227 2011/07/02 22:20:07 nicm Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2632,7 +2632,7 @@ acpikqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &acpiread_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = sc;
@@ -2667,6 +2667,6 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
int
acpikqfilter(dev_t dev, struct knote *kn)
{
- return (1);
+ return (ENXIO);
}
#endif /* SMALL_KERNEL */
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index bb693256e28..66a825312e3 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.112 2011/06/06 06:13:45 deraadt Exp $ */
+/* $OpenBSD: audio.c,v 1.113 2011/07/02 22:20:07 nicm Exp $ */
/* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */
/*
@@ -3309,7 +3309,7 @@ audiokqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &audiowrite_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (void *)sc;
diff --git a/sys/dev/cons.c b/sys/dev/cons.c
index 717165b210e..df76b84d515 100644
--- a/sys/dev/cons.c
+++ b/sys/dev/cons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cons.c,v 1.21 2011/04/19 21:53:36 chl Exp $ */
+/* $OpenBSD: cons.c,v 1.22 2011/07/02 22:20:07 nicm Exp $ */
/* $NetBSD: cons.c,v 1.30 1996/04/08 19:57:30 jonathan Exp $ */
/*
@@ -214,12 +214,12 @@ cnkqfilter(dev_t dev, struct knote *kn)
if (constty != NULL)
dev = constty->t_dev;
else if (cn_tab == NULL)
- return (1);
+ return (ENXIO);
else
dev = cn_tab->cn_dev;
if (cdevsw[major(dev)].d_flags & D_KQFILTER)
return ((*cdevsw[major(dev)].d_kqfilter)(dev, kn));
- return (1);
+ return (ENXIO);
}
int
diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c
index 0013b67d0b5..2936751b04b 100644
--- a/sys/dev/hotplug.c
+++ b/sys/dev/hotplug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplug.c,v 1.11 2010/12/15 03:34:33 tedu Exp $ */
+/* $OpenBSD: hotplug.c,v 1.12 2011/07/02 22:20:07 nicm Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -204,7 +204,7 @@ hotplugkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &hotplugread_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
s = splbio();
diff --git a/sys/dev/midi.c b/sys/dev/midi.c
index ae6644e50e9..d0fb2bb9a5c 100644
--- a/sys/dev/midi.c
+++ b/sys/dev/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.25 2011/01/27 20:37:19 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.26 2011/07/02 22:20:07 nicm Exp $ */
/*
* Copyright (c) 2003, 2004 Alexandre Ratchov
@@ -401,7 +401,7 @@ midikqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &midiwrite_filtops;
break;
default:
- return (EPERM);
+ return (EINVAL);
}
kn->kn_hook = (void *)sc;
diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c
index 4f77257b76c..c50750cf05e 100644
--- a/sys/dev/sequencer.c
+++ b/sys/dev/sequencer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sequencer.c,v 1.21 2011/06/23 16:02:33 tedu Exp $ */
+/* $OpenBSD: sequencer.c,v 1.22 2011/07/02 22:20:07 nicm Exp $ */
/* $NetBSD: sequencer.c,v 1.13 1998/11/25 22:17:07 augustss Exp $ */
/*
@@ -618,7 +618,7 @@ sequencerpoll(dev_t dev, int events, struct proc *p)
int
sequencerkqfilter(dev_t dev, struct knote *kn)
{
- return (EPERM);
+ return (ENXIO);
}
void
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;
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 3b564cbf39a..0a4393f9e5a 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.51 2011/01/25 20:03:36 jakemsr Exp $ */
+/* $OpenBSD: uhid.c,v 1.52 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -564,7 +564,7 @@ uhidkqfilter(dev_t dev, struct knote *kn)
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (void *)sc;
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index 2ef694688d7..59c39033957 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uscanner.c,v 1.44 2011/01/25 20:03:36 jakemsr Exp $ */
+/* $OpenBSD: uscanner.c,v 1.45 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $ */
/*
@@ -656,7 +656,7 @@ uscannerkqfilter(dev_t dev, struct knote *kn)
sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
if (sc->sc_dying)
- return (1);
+ return (ENXIO);
switch (kn->kn_filter) {
case EVFILT_READ:
@@ -671,7 +671,7 @@ uscannerkqfilter(dev_t dev, struct knote *kn)
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (void *)sc;
diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c
index 15ad5d1576c..e7341e20fdd 100644
--- a/sys/dev/vscsi.c
+++ b/sys/dev/vscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vscsi.c,v 1.23 2011/04/28 11:24:36 dlg Exp $ */
+/* $OpenBSD: vscsi.c,v 1.24 2011/07/02 22:20:07 nicm Exp $ */
/*
* Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
@@ -504,7 +504,7 @@ vscsikqfilter(dev_t dev, struct knote *kn)
break;
default:
device_unref(&sc->sc_dev);
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (caddr_t)sc;