summaryrefslogtreecommitdiff
path: root/sys/kern
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/kern
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/kern')
-rw-r--r--sys/kern/kern_event.c4
-rw-r--r--sys/kern/subr_log.c4
-rw-r--r--sys/kern/tty.c4
-rw-r--r--sys/kern/tty_pty.c4
-rw-r--r--sys/kern/uipc_socket.c4
-rw-r--r--sys/kern/vfs_default.c4
6 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 2475ba0f50d..d43c013d4c2 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.40 2011/05/03 15:59:50 marco Exp $ */
+/* $OpenBSD: kern_event.c,v 1.41 2011/07/02 22:20:08 nicm Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -164,7 +164,7 @@ kqueue_kqfilter(struct file *fp, struct knote *kn)
struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
if (kn->kn_filter != EVFILT_READ)
- return (1);
+ return (EINVAL);
kn->kn_fop = &kqread_filtops;
SLIST_INSERT_HEAD(&kq->kq_sel.si_note, kn, kn_selnext);
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 01550138f57..84fa91dcba9 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_log.c,v 1.16 2009/11/09 17:53:39 nicm Exp $ */
+/* $OpenBSD: subr_log.c,v 1.17 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
@@ -219,7 +219,7 @@ logkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &logread_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (void *)msgbufp;
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 1cf4a411f35..a56d88c258d 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.91 2011/04/18 21:44:56 guenther Exp $ */
+/* $OpenBSD: tty.c,v 1.92 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -1099,7 +1099,7 @@ ttkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &ttywrite_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (caddr_t)((u_long)dev);
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 8539d2d54ce..54f7b0d7ec5 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.55 2011/04/18 21:44:56 guenther Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.56 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -741,7 +741,7 @@ ptckqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &ptcwrite_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
kn->kn_hook = (caddr_t)pti;
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index e06ce48339f..fc8811726de 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.92 2011/05/02 13:48:38 mikeb Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.93 2011/07/02 22:20:08 nicm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1638,7 +1638,7 @@ soo_kqfilter(struct file *fp, struct knote *kn)
sb = &so->so_snd;
break;
default:
- return (1);
+ return (EINVAL);
}
s = splnet();
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 32527afcdb7..f43f3f90fd6 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_default.c,v 1.37 2008/05/03 14:41:29 thib Exp $ */
+/* $OpenBSD: vfs_default.c,v 1.38 2011/07/02 22:20:08 nicm Exp $ */
/*
* Portions of this code are:
@@ -200,7 +200,7 @@ vop_generic_kqfilter(void *v)
kn->kn_fop = &generic_filtops;
break;
default:
- return (1);
+ return (EINVAL);
}
return (0);