diff options
author | Vincent Lefevre <vincent@vinc17.net> | 2022-02-17 02:42:31 +0200 |
---|---|---|
committer | Alexander Naumov <alexander_naumov@opensuse.org> | 2022-02-17 02:42:31 +0200 |
commit | 1bfe555cd334feccdf55a0fd2891f743b2ffc7a0 (patch) | |
tree | 477bf9a238c31fa5d0b7aebaa83e4b1f5308fd39 | |
parent | 7da80e460b546255ca3fccb3aa2e8cae796457a9 (diff) | |
download | screen-1bfe555cd334feccdf55a0fd2891f743b2ffc7a0.tar.gz |
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
-rw-r--r-- | src/utmp.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -582,6 +582,15 @@ struct win *wi; addToUtmp(wi->w_tty, host, wi->w_ptyfd); else removeLineFromUtmp(wi->w_tty, wi->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 */ } #endif |