aboutsummaryrefslogtreecommitdiff
path: root/toys/other/timeout.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-11-02 20:07:02 -0500
committerRob Landley <rob@landley.net>2018-11-02 20:07:02 -0500
commit6a73e13d75d31da2c3f1145d8487725f0073a4b8 (patch)
tree17b5bb8b6b5e94b1c93818954cf322a39941a4be /toys/other/timeout.c
parent49e1d8733ebcaf130623c68a2393a3c43702a524 (diff)
downloadtoybox-6a73e13d75d31da2c3f1145d8487725f0073a4b8.tar.gz
Convert more option vars to the new (single letter) coding style.
Diffstat (limited to 'toys/other/timeout.c')
-rw-r--r--toys/other/timeout.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/toys/other/timeout.c b/toys/other/timeout.c
index b903c3ec..51e3a7e3 100644
--- a/toys/other/timeout.c
+++ b/toys/other/timeout.c
@@ -28,8 +28,7 @@ config TIMEOUT
#include "toys.h"
GLOBALS(
- char *s_signal;
- char *k_timeout;
+ char *s, *k;
int nextsig;
pid_t pid;
@@ -43,8 +42,8 @@ static void handler(int i)
fprintf(stderr, "timeout pid %d signal %d\n", TT.pid, TT.nextsig);
kill(TT.pid, TT.nextsig);
- if (TT.k_timeout) {
- TT.k_timeout = 0;
+ if (TT.k) {
+ TT.k = 0;
TT.nextsig = SIGKILL;
xsignal(SIGALRM, handler);
TT.itv.it_value = TT.ktv;
@@ -66,11 +65,11 @@ void timeout_main(void)
{
// Parse early to get any errors out of the way.
xparsetimeval(*toys.optargs, &TT.itv.it_value);
- if (TT.k_timeout) xparsetimeval(TT.k_timeout, &TT.ktv);
+ if (TT.k) xparsetimeval(TT.k, &TT.ktv);
TT.nextsig = SIGTERM;
- if (TT.s_signal && -1 == (TT.nextsig = sig_to_num(TT.s_signal)))
- error_exit("bad -s: '%s'", TT.s_signal);
+ if (TT.s && -1 == (TT.nextsig = sig_to_num(TT.s)))
+ error_exit("bad -s: '%s'", TT.s);
if (!(TT.pid = XVFORK())) xexec(toys.optargs+1);
else {