From e4103b8183cfb9992badd3fbc9827e9bc4a74c38 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 25 Aug 2022 04:56:50 -0500 Subject: [PATCH] Cosmetic tweak. (TT starts zeroed so we don't need to initialize fields to zero, while touching it move that down to right before its first potential user, and de-wordwrap a line that's close enough to cheat on the spacking.) --- toys/other/timeout.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/toys/other/timeout.c b/toys/other/timeout.c index 2eac53d3..6454c66b 100644 --- a/toys/other/timeout.c +++ b/toys/other/timeout.c @@ -52,22 +52,18 @@ void timeout_main(void) int ii, ms, nextsig; struct timespec tts, kts; - TT.fds[0] = 0; - TT.fds[1] = -1; - // Use same ARGFAIL value for any remaining parsing errors toys.exitval = 125; xparsetimespec(*toys.optargs, &tts); if (TT.k) xparsetimespec(TT.k, &kts); nextsig = SIGTERM; - if (TT.s && -1 == (nextsig = sig_to_num(TT.s))) - error_exit("bad -s: '%s'", TT.s); - + if (TT.s && -1==(nextsig = sig_to_num(TT.s))) error_exit("bad -s: '%s'",TT.s); if (!FLAG(foreground)) setpgid(0, 0); toys.exitval = 0; TT.pfd.events = POLLIN; + TT.fds[1] = -1; if (sigsetjmp(TT.sj, 1)) goto done; xsignal_flags(SIGCHLD, handler, SA_NOCLDSTOP); TT.pid = xpopen_both(toys.optargs+1, FLAG(i) ? TT.fds : 0); -- 2.39.2