diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-10-08 06:24:35 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-10-08 06:24:35 -0400 |
commit | 5bcecbb75127bb5d7940b4c391888dd1fe8915c9 (patch) | |
tree | bc3f7f2aa1a0b3350d37397d17444564fb8ca5b0 | |
parent | Merge pull request #188 from taiyu-len/master (diff) | |
download | sway-5bcecbb75127bb5d7940b4c391888dd1fe8915c9.tar.gz sway-5bcecbb75127bb5d7940b4c391888dd1fe8915c9.tar.zst sway-5bcecbb75127bb5d7940b4c391888dd1fe8915c9.zip |
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) { | |||
22 | wlc_terminate(); | 22 | wlc_terminate(); |
23 | } | 23 | } |
24 | 24 | ||
25 | static void sigchld_handle(int signal); | ||
26 | |||
25 | static void wlc_log_handler(enum wlc_log_type type, const char *str) { | 27 | static void wlc_log_handler(enum wlc_log_type type, const char *str) { |
26 | if (type == WLC_LOG_ERROR) { | 28 | if (type == WLC_LOG_ERROR) { |
27 | sway_log(L_ERROR, "[wlc] %s", str); | 29 | sway_log(L_ERROR, "[wlc] %s", str); |
@@ -62,8 +64,8 @@ int main(int argc, char **argv) { | |||
62 | {0, 0, 0, 0} | 64 | {0, 0, 0, 0} |
63 | }; | 65 | }; |
64 | 66 | ||
65 | /* clean zombie processes */ | 67 | /* Signal handling */ |
66 | signal(SIGCHLD, SIG_IGN); | 68 | signal(SIGCHLD, sigchld_handle); |
67 | 69 | ||
68 | setenv("WLC_DIM", "0", 0); | 70 | setenv("WLC_DIM", "0", 0); |
69 | 71 | ||
@@ -150,3 +152,8 @@ int main(int argc, char **argv) { | |||
150 | 152 | ||
151 | return 0; | 153 | return 0; |
152 | } | 154 | } |
155 | |||
156 | void sigchld_handle(int signal) { | ||
157 | (void) signal; | ||
158 | while (waitpid((pid_t)-1, 0, WNOHANG) > 0); | ||
159 | } | ||