Fix hang (issue #586)

This commit is contained in:
o9000 2016-08-08 12:17:15 +02:00
parent da51d37322
commit cf930fa42e

View file

@ -416,7 +416,7 @@ static void sigchld_handler_async()
// Wait for all dead processes // Wait for all dead processes
pid_t pid; pid_t pid;
int status; int status;
while ((pid = waitpid(-1, &status, WNOHANG)) != -1) { while ((pid = waitpid(-1, &status, WNOHANG)) != -1 && pid != 0) {
#ifdef HAVE_SN #ifdef HAVE_SN
SnLauncherContext *ctx = (SnLauncherContext *)g_tree_lookup(server.pids, GINT_TO_POINTER(pid)); SnLauncherContext *ctx = (SnLauncherContext *)g_tree_lookup(server.pids, GINT_TO_POINTER(pid));
if (ctx) { if (ctx) {