When traced command is terminated by a blocked signal, unblock
that signal to ensure strace termination with the same signal.
* strace.c (main): Unblock the signal raised for strace termination.
* NEWS: Mention this change.
* In interactive mode (-I2), those signals that were blocked at startup
will remain blocked for the whole period of strace execution.
* strace no longer resets SIGCHLD handler in tracees to the default action.
+ * When traced command is terminated by a blocked signal, strace unblocks
+ that signal to ensure its own termination with the same signal.
Noteworthy changes in release 4.17 (2017-05-24)
===============================================
exit_code &= 0xff;
signal(exit_code, SIG_DFL);
raise(exit_code);
+
+ /* Unblock the signal. */
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, exit_code);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
+
/* Paranoia - what if this signal is not fatal?
Exit with 128 + signo then. */
exit_code += 128;