3 ms·
I found my original submission to the email list. https://www.spinics.net/lists/dash/msg02208.html https://www.spinics.net/lists/dash/msg02208.html "Signal te
by chasil 3y ago
I found my original submission to the email list.
https://www.spinics.net/lists/dash/msg02208.html https://www.spinics.net/lists/dash/msg02208.html
"Signal terminations are not caught by EXIT. It only catches normal
exits. Unfortunately, the EXIT condition is not well-defined by POSIX, so it's left to interpretation."
...
POSIX is making it unspecified what happens here:
https://austingroupbugs.net/view.php?id=621 https://austingroupbugs.net/view.php?id=621
The EXIT condition shall occur when the shell terminates normally (exits), and may occur when the shell terminates abnormally as a
result of delivery of a signal (other than SIGKILL) whose trap
action is the default.
- usr1106 3y agoWhy do people write such standards? May occur. I don't need a standard to do something random.
- usr1106 3y agoI guess to get a well-defined behavior the interrupt handler needs to clear the EXIT trap.
- rigelina 3y agoIn this type of scenario, it's sometimes because there are two or more implementors that are trying to develop the standard in a way that makes their existing implementation compliant. Likely there were existing scripts that relied on the behavior being specific to that implementation, so it was explicitly made optional, which is viewed as better than not adding the behavior to the standard at all. "May" is just a polite standards way of saying "Warning: check yourself before you wreck yourself."