According to Dmitry V. Levin on 1/30/2010 12:18 PM:
> The value of `$?' on entrance to signal handlers in shell scripts
> cannot be relied upon, so set the exit code explicitly to
> 128 + SIGTERM == 143.
> * src/Makefile.am (sc_tight_scope): Use `exit 143' in signal handler.

I'm not sure I like the direction this is headed in.  Exiting with 143
when a trap is known to be caused by SIGTERM might be okay, but it would
be even better to reraise the signal and make the shell also exit by
SIGTERM (in case the caller can distinguish between exit by signal and
normal exit by status > 128).  But blindly giving status 143 for other
signals, like SIGHUP, is just wrong.  If you are going to munge trap
handlers to account for races, then you need one trap handler per signal
with an appropriate exit status for each.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to