Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reap zombie children on i3 start #5909

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,17 @@ int main(int argc, char *argv[]) {
* when calling exit() */
atexit(i3_exit);

/* There might be children who died before we initialized the event loop,
* e.g., when restarting i3 (see #5756).
* To not carry zombie children around, raise the signal to invite libev to
* reap them.
*
* Note that there is no race condition between raising the signal below and
* entering the event loop later: the signal is just to notify libev that
* zombies might already be there. Actuall reaping will take place in the
* event loop anyway. */
(void)raise(SIGCHLD);

sd_notify(1, "READY=1");
ev_loop(main_loop, 0);

Expand Down