diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-19 09:55:37 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-19 09:55:37 +0000 |
commit | 1d0095968bbcdd83e153873f85d70bd88bf7f314 (patch) | |
tree | fe9faa87675730a426625b5c6186afd3ad62b7de /usr.sbin/sade/system.c | |
parent | 45f24bb16eb909ab1f7566fbf4a770f73f6543b5 (diff) | |
download | FreeBSD-src-1d0095968bbcdd83e153873f85d70bd88bf7f314.zip FreeBSD-src-1d0095968bbcdd83e153873f85d70bd88bf7f314.tar.gz |
Use alarm's return status to more properly denote timeout rather than keeping
an icky global around.
Diffstat (limited to 'usr.sbin/sade/system.c')
-rw-r--r-- | usr.sbin/sade/system.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index 1fc4696..0854cca 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -47,9 +47,6 @@ handle_intr(int sig) restorescr(save); } -/* Public variable for ease of use - handler should set it if interested */ -Boolean AlarmWentOff; - /* Simple alarm interface */ void alarm_set(int delay, void (*handler)(int sig)) @@ -60,20 +57,20 @@ alarm_set(int delay, void (*handler)(int sig)) act.sa_flags = 0; act.sa_mask = 0; sigaction(SIGALRM, &act, NULL); - AlarmWentOff = FALSE; alarm(delay); } -void +int alarm_clear(void) { struct sigaction act; + int i = alarm(0); - alarm(0); act.sa_handler = SIG_DFL; act.sa_flags = 0; act.sa_mask = 0; sigaction(SIGALRM, &act, NULL); + return i; } /* Expand a file into a convenient location, nuking it each time */ |