mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-10 09:22:04 +02:00
Avoid zombies after shell exit
As documented in libutempter: "During execution of the privileged process spawned by these functions, SIGCHLD signal handler will be temporarily set to the default action." Thus in case a SIGCHLD has been lost, we send a SIGCHLD to oneself in order to avoid zombies: https://savannah.gnu.org/bugs/?25089
This commit is contained in:
committed by
Alexander Naumov
parent
3aa385ea52
commit
c56ab476b9
10
src/utmp.c
10
src/utmp.c
@@ -349,6 +349,16 @@ static int pututslot(slot_t slot, struct utmpx *u, char *host, Window *win)
|
||||
utempter_add_record(win->w_ptyfd, host);
|
||||
else
|
||||
utempter_remove_record(win->w_ptyfd);
|
||||
/*
|
||||
* As documented in libutempter: "During execution of
|
||||
* the privileged process spawned by these functions,
|
||||
* SIGCHLD signal handler will be temporarily set to
|
||||
* the default action." Thus in case a SIGCHLD has
|
||||
* been lost, we send a SIGCHLD to oneself in order to
|
||||
* avoid zombies: https://savannah.gnu.org/bugs/?25089
|
||||
*/
|
||||
kill(getpid(), SIGCHLD);
|
||||
|
||||
return 1; /* pray for success */
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user