[PATCH 1/2] Don't hang in wait if suspended/resumed
spitzak at gmail.com
spitzak at gmail.com
Sun Mar 18 21:46:11 PDT 2012
From: Bill Spitzak <spitzak at lulu.(none)>
Pausing weston (with ^Z in the shell) and putting it in the background
made it hang.
It actually never called sigchld when I killed or made clients exit,
so it is not clear if this handler is needed at all.
---
src/compositor.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/compositor.c b/src/compositor.c
index f2ae2f6..914c6c9 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -59,7 +59,9 @@ sigchld_handler(int signal_number, void *data)
int status;
pid_t pid;
- pid = wait(&status);
+ pid = waitpid(-1, &status, WNOHANG);
+ if (!pid) return 1;
+
wl_list_for_each(p, &child_process_list, link) {
if (p->pid == pid)
break;
--
1.7.4.1
More information about the wayland-devel
mailing list