summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-01-29 22:18:07 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-01-29 22:18:07 +0000
commit89c9af902e342d2d6df67b4a4e6cfda04adead14 (patch)
treea6921ed3e0de7b2e17ea700577e8641e1875f7a1
parent5bc29bfdb5aa39690bd2dd895dde60ffa6d1da57 (diff)
Remove KASSERT() that could trigger when an rthread in sigwait()
got multiple signals before tsleep() could wakeup. Also, POSIX says that sigwait() should never return EINTR, so map that to ERESTART. ok kurt@, tedu@ fixes the panic encountered by ariane@ with kaffe
-rw-r--r--sys/kern/kern_sig.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 63d01e252c1..ed52c212eca 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.101 2008/12/16 07:57:28 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.102 2009/01/29 22:18:06 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1532,12 +1532,11 @@ sys_thrsigdivert(struct proc *p, void *v, register_t *retval)
/* interrupted */
KASSERT(error != 0);
atomic_clearbits_int(&p->p_sigdivert, ~0);
- if (error == ERESTART)
- error = EINTR;
+ if (error == EINTR)
+ error = ERESTART;
return (error);
}
- KASSERT(error == 0);
KASSERT(p->p_sigwait != 0);
*retval = p->p_sigwait;
return (0);