were first renamed or unlinked or never modified.
[The race was introduced in coreutils-7.5]
+ timeout now doesn't exit unless the command it is monitoring does,
+ for any specified signal. [bug introduced in coreutils-7.0].
+
** Changes in behavior
chroot, env, nice, and su fail with status 125, rather than 1, on
}
static void
-install_signal_handlers (void)
+install_signal_handlers (int sigterm)
{
struct sigaction sa;
sigemptyset(&sa.sa_mask); /* Allow concurrent calls to handler */
sigaction (SIGALRM, &sa, NULL); /* our timeout. */
sigaction (SIGINT, &sa, NULL); /* Ctrl-C at terminal for example. */
sigaction (SIGQUIT, &sa, NULL); /* Ctrl-\ at terminal for example. */
- sigaction (SIGTERM, &sa, NULL); /* if we're killed, stop monitored proc. */
sigaction (SIGHUP, &sa, NULL); /* terminal closed for example. */
+ sigaction (SIGTERM, &sa, NULL); /* if we're killed, stop monitored proc. */
+ sigaction (sigterm, &sa, NULL); /* user specified termination signal. */
}
int
/* Setup handlers before fork() so that we
handle any signals caused by child, without races. */
- install_signal_handlers ();
+ install_signal_handlers (term_signal);
signal (SIGTTIN, SIG_IGN); /* don't sTop if background child needs tty. */
signal (SIGTTOU, SIG_IGN); /* don't sTop if background child needs tty. */