summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-15 11:22:17 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-15 11:22:17 +0000
commitf1fc405fd29965ce09c88e13224a783de19a58b3 (patch)
treee5264b7b634bf75e997fb33157d6368deeea41da /sys/kern
parente83f53bb855669ad1ea9af15b06d0cf575334c41 (diff)
copyout() the pollfds if poll() gets interrupted. This resets the revents
bitmask and makes poll() behave like documented in the man page. OK deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 584d4f87783..548b2ef82fb 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.51 2005/12/13 10:33:14 jsg Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.52 2006/03/15 11:22:16 claudio Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -928,7 +928,9 @@ done:
*/
switch (error) {
case ERESTART:
- error = EINTR;
+ error = copyout(pl, SCARG(uap, fds), sz);
+ if (error == 0)
+ error = EINTR;
break;
case EWOULDBLOCK:
case 0: