restore SIGCHLD settings to SIG_DFL. #600 #636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I startup "Terminator", a terminal emulator, from Waybar button.
Waybar forks on button click, and the child process executes Terminator,
and the Waybar process itself setups SIGCHLD to SIG_IGN to discard defunct child processes.
But the SIGCHLD setting is inherited to a new child process on fork when I click the button next time.
That is why Terminator startups with SIGCHLD setting of SIG_IGN on the second click.
Terminator forks, executes
uname -p
, and waits finishing of theuname -p
process.But because Terminator's SIGCHLD setting is SIG_IGN,
uname -p
process disappears just after it exits,and Terminator can't wait it, raise an exeception, and exits.
The solution is to restore SIGCHLD setting of child processes to SIG_DFL after forks.
Then, Terminator's SIGCHLD setting becomes SIG_DFL, and
uname -p
process doesn't disappears untilTerminator waits.