diff options
author | peter <peter@FreeBSD.org> | 1997-10-15 13:58:52 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-10-15 13:58:52 +0000 |
commit | d842f3f837a4eafa616c969c48d23e6b6370d34c (patch) | |
tree | 034e57a9c2e53b9ae82defcb9a633911d2b189e2 /sys/kern/kern_time.c | |
parent | f7aabc3ac9f5e7e265942303c10f94c847a7ef2d (diff) | |
download | FreeBSD-src-d842f3f837a4eafa616c969c48d23e6b6370d34c.zip FreeBSD-src-d842f3f837a4eafa616c969c48d23e6b6370d34c.tar.gz |
Sigh. Signal handlers are executed on leaving the system call, not
at moment of delivery. Restoring the signal mask after the tsleep()
is next to useless since the signal is still queued.. This was interacting
with usleep(3) on receipt of a SIGALRM causing it to near busy loop.
Now, we set the new signal mask "permanently" for signanosleep().
Problem noted by: bde
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r-- | sys/kern/kern_time.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 754849a..7576d07 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.34 1997/09/02 20:05:49 bde Exp $ + * $Id: kern_time.c,v 1.35 1997/09/21 22:00:16 gibbs Exp $ */ #include <sys/param.h> @@ -342,17 +342,11 @@ signanosleep(p, uap, retval) if (error) return (error); - /* See kern_sig.c:sigsuspend() for explanation. */ - ps->ps_oldmask = p->p_sigmask; - ps->ps_flags |= SAS_OLDMASK; + /* change mask for sleep */ p->p_sigmask = mask &~ sigcantmask; error = nanosleep1(p, &rqt, &rmt); - /* See kern_sig.c:sigsuspend() again. */ - p->p_sigmask = ps->ps_oldmask; /* in case timeout rather than sig */ - ps->ps_flags &= ~SAS_OLDMASK; - if (SCARG(uap, rmtp)) { error2 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt)); if (error2) /* XXX shouldn't happen, did useracc() above */ |