Slight simplification.
This commit is contained in:
parent
1eaf5ee379
commit
c2102b50ad
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sleep.c,v 1.13 1995/10/26 22:07:00 pk Exp $ */
|
||||
/* $NetBSD: sleep.c,v 1.14 1996/05/11 11:04:51 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
static char rcsid[] = "$NetBSD: sleep.c,v 1.13 1995/10/26 22:07:00 pk Exp $";
|
||||
static char rcsid[] = "$NetBSD: sleep.c,v 1.14 1996/05/11 11:04:51 mycroft Exp $";
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -104,12 +104,7 @@ sleep(seconds)
|
||||
ringring = 0;
|
||||
(void) sigsuspend(&set);
|
||||
|
||||
if (ringring) {
|
||||
/* Our alarm went off; timer is not currently running */
|
||||
sigaction(SIGALRM, &oact, NULL);
|
||||
sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
(void) setitimer(ITIMER_REAL, &oitv, &itv);
|
||||
} else {
|
||||
if (!ringring) {
|
||||
struct itimerval nulltv;
|
||||
/*
|
||||
* Interrupted by other signal; allow for pending
|
||||
@ -119,10 +114,10 @@ sleep(seconds)
|
||||
timerclear(&nulltv.it_interval);
|
||||
timerclear(&nulltv.it_value);
|
||||
(void) setitimer(ITIMER_REAL, &nulltv, &itv);
|
||||
sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
sigaction(SIGALRM, &oact, NULL);
|
||||
(void) setitimer(ITIMER_REAL, &oitv, NULL);
|
||||
}
|
||||
sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
sigaction(SIGALRM, &oact, NULL);
|
||||
(void) setitimer(ITIMER_REAL, &oitv, &itv);
|
||||
|
||||
if (timerisset(&diff))
|
||||
timeradd(&itv.it_value, &diff, &itv.it_value);
|
||||
|
Loading…
Reference in New Issue
Block a user