diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-14 13:32:10 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-14 13:32:51 -0400 |
commit | cfa910af9694de0dd218713f66d521ee85c4070c (patch) | |
tree | 9848e19fff3c89f350ff7c02f8bbd4d258182d7f | |
parent | 59352d43f42d39a69c718fc03f622aae324b325e (diff) | |
download | jack1-cfa910af9694de0dd218713f66d521ee85c4070c.tar.gz |
fix for double-fork still leaving zombies around (from Uli Franke uli.franke@weiss.ch)
m--------- | jack | 0 | ||||
-rw-r--r-- | libjack/client.c | 11 | ||||
m--------- | tools | 0 |
3 files changed, 10 insertions, 1 deletions
diff --git a/jack b/jack -Subproject 60ee937d197b06e69424e5b848fbe744b42f4d1 +Subproject 88d3f257bab3ad5021b30e405eee27aa56e97cf diff --git a/libjack/client.c b/libjack/client.c index 52f9ae7..e06617f 100644 --- a/libjack/client.c +++ b/libjack/client.c @@ -962,6 +962,9 @@ failure: int start_server (const char *server_name, jack_options_t options) { + int status; + pid_t first_child_pid; + if ((options & JackNoStartServer) || getenv("JACK_NO_START_SERVER")) { return 1; @@ -976,7 +979,10 @@ start_server (const char *server_name, jack_options_t options) * virtual memory tricks, the overhead of the second fork() is * probably relatively small. */ - switch (fork()) { + + first_child_pid = fork(); + + switch (first_child_pid) { case 0: /* child process */ switch (fork()) { case 0: /* grandchild process */ @@ -991,6 +997,9 @@ start_server (const char *server_name, jack_options_t options) return 1; /* failed to start server */ } + /* reap the initaial child */ + waitpid (first_child_pid, &status, 0); + /* only the original parent process goes here */ return 0; /* (probably) successful */ } diff --git a/tools b/tools -Subproject 76056b1332d26a3f457a7cd7fd4a4e1a74701d2 +Subproject 39c1130416b47bd9c156fd9b3b460f51776e0df |