summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorStephane Letz <letz@grame.fr>2014-02-26 15:53:30 +0100
committerStephane Letz <letz@grame.fr>2014-02-26 15:53:30 +0100
commitf19cd3c1ddb19305ec6830e72658c121a8c9accc (patch)
tree32a1e7097cddc77c544b2c11d9d34558ec5767c9 /posix
parent9a48112658ce6e8767aff3327a4e8e2b6248e318 (diff)
downloadjack2-f19cd3c1ddb19305ec6830e72658c121a8c9accc.tar.gz
Uli Franke patch for start_server_classic.
Diffstat (limited to 'posix')
-rw-r--r--posix/JackPosixServerLaunch.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/posix/JackPosixServerLaunch.cpp b/posix/JackPosixServerLaunch.cpp
index 44ec4171..e4d3985c 100644
--- a/posix/JackPosixServerLaunch.cpp
+++ b/posix/JackPosixServerLaunch.cpp
@@ -29,6 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackServerLaunch.h"
#include "JackPlatformPlug.h"
+#include <sys/wait.h>
+
using namespace Jack;
#if defined(USE_LIBDBUS_AUTOLAUNCH)
@@ -175,7 +177,12 @@ static int start_server_classic(const char* server_name)
* virtual memory tricks, the overhead of the second fork() is
* probably relatively small.
*/
- switch (fork()) {
+
+ int status;
+ pid_t first_child_pid;
+
+ first_child_pid = fork();
+ switch (first_child_pid) {
case 0: /* child process */
switch (fork()) {
case 0: /* grandchild process */
@@ -189,6 +196,7 @@ static int start_server_classic(const char* server_name)
case - 1: /* fork() error */
return 1; /* failed to start server */
}
+ waitpid(first_child_pid, &status, 0);
/* only the original parent process goes here */
return 0; /* (probably) successful */