diff options
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/login.c | 2 | ||||
-rw-r--r-- | toys/other/netcat.c | 3 | ||||
-rw-r--r-- | toys/other/timeout.c | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/toys/other/login.c b/toys/other/login.c index 0d6d3640..837dd977 100644 --- a/toys/other/login.c +++ b/toys/other/login.c @@ -156,7 +156,7 @@ void login_main(void) if (!isatty(0) || !isatty(1) || !isatty(2)) error_exit("no tty"); openlog("login", LOG_PID | LOG_CONS, LOG_AUTH); - signal(SIGALRM, login_timeout_handler); + xsignal(SIGALRM, login_timeout_handler); alarm(TT.login_timeout = 60); for (ss = forbid; *ss; ss++) unsetenv(*ss); diff --git a/toys/other/netcat.c b/toys/other/netcat.c index d27aa885..453a7ca0 100644 --- a/toys/other/netcat.c +++ b/toys/other/netcat.c @@ -54,12 +54,13 @@ GLOBALS( static void timeout(int signum) { if (TT.wait) error_exit("Timeout"); + // This should be xexit() but would need siglongjmp()... exit(0); } static void set_alarm(int seconds) { - signal(SIGALRM, seconds ? timeout : SIG_DFL); + xsignal(SIGALRM, seconds ? timeout : SIG_DFL); alarm(seconds); } diff --git a/toys/other/timeout.c b/toys/other/timeout.c index 6da2d2e2..06b1e89a 100644 --- a/toys/other/timeout.c +++ b/toys/other/timeout.c @@ -45,7 +45,7 @@ static void handler(int i) if (TT.k_timeout) { TT.k_timeout = 0; TT.nextsig = SIGKILL; - signal(SIGALRM, handler); + xsignal(SIGALRM, handler); TT.itv.it_value = TT.ktv; setitimer(ITIMER_REAL, &TT.itv, (void *)toybuf); } @@ -66,7 +66,7 @@ void timeout_main(void) else { int status; - signal(SIGALRM, handler); + xsignal(SIGALRM, handler); setitimer(ITIMER_REAL, &TT.itv, (void *)toybuf); while (-1 == waitpid(TT.pid, &status, 0) && errno == EINTR); toys.exitval = WIFEXITED(status) |