diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-10-08 06:24:41 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-10-08 06:24:41 -0400 |
commit | d2680ac8fe43c9469b0a2cc00ca53612bcab8438 (patch) | |
tree | bc3f7f2aa1a0b3350d37397d17444564fb8ca5b0 | |
parent | 05c86f7f9929d10be89ef5e535a363ee951894c8 (diff) | |
parent | 5bcecbb75127bb5d7940b4c391888dd1fe8915c9 (diff) |
Merge pull request #189 from SirCmpwn/revert-188-master
Revert "#187 cleanup zombies properly"
-rw-r--r-- | sway/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/main.c b/sway/main.c index 93dbae8d..66921184 100644 --- a/sway/main.c +++ b/sway/main.c @@ -22,6 +22,8 @@ void sway_terminate(void) { wlc_terminate(); } +static void sigchld_handle(int signal); + static void wlc_log_handler(enum wlc_log_type type, const char *str) { if (type == WLC_LOG_ERROR) { sway_log(L_ERROR, "[wlc] %s", str); @@ -62,8 +64,8 @@ int main(int argc, char **argv) { {0, 0, 0, 0} }; - /* clean zombie processes */ - signal(SIGCHLD, SIG_IGN); + /* Signal handling */ + signal(SIGCHLD, sigchld_handle); setenv("WLC_DIM", "0", 0); @@ -150,3 +152,8 @@ int main(int argc, char **argv) { return 0; } + +void sigchld_handle(int signal) { + (void) signal; + while (waitpid((pid_t)-1, 0, WNOHANG) > 0); +} |