diff options
author | Rob Landley <rob@landley.net> | 2015-09-29 05:09:46 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-09-29 05:09:46 -0500 |
commit | 7d6af77804adc069a83e8566250f868a6cb9786e (patch) | |
tree | 92b6b57f55c41ab13164c1d448b3cdd1129703b4 /toys/other/timeout.c | |
parent | 3b51a07e478d64a84e40b3a7c026b2f8566b194b (diff) | |
download | toybox-7d6af77804adc069a83e8566250f868a6cb9786e.tar.gz |
Make defconfig build for nommu.
Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL
argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some
unconverted commands.
Diffstat (limited to 'toys/other/timeout.c')
-rw-r--r-- | toys/other/timeout.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/toys/other/timeout.c b/toys/other/timeout.c index bd716e63..0e912f7c 100644 --- a/toys/other/timeout.c +++ b/toys/other/timeout.c @@ -62,14 +62,10 @@ void timeout_main(void) if (TT.s_signal && -1 == (TT.nextsig = sig_to_num(TT.s_signal))) error_exit("bad -s: '%s'", TT.s_signal); - if (!(TT.pid = xvfork())) xexec(toys.optargs+1); + if (!(TT.pid = XVFORK())) xexec(toys.optargs+1); else { - int status; - xsignal(SIGALRM, handler); setitimer(ITIMER_REAL, &TT.itv, (void *)toybuf); - while (-1 == waitpid(TT.pid, &status, 0) && errno == EINTR); - toys.exitval = WIFEXITED(status) - ? WEXITSTATUS(status) : WTERMSIG(status) + 127; + toys.exitval = xwaitpid(TT.pid); } } |