Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
spawn: another reap fix (zero return code), fixes #2800
  • Loading branch information
perexg committed Apr 24, 2015
1 parent 536736d commit d4f1c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spawn.c
Expand Up @@ -242,7 +242,7 @@ spawn_reap(pid_t wpid, char *stxt, size_t stxtlen)
if(pid < 0)
return -errno;
if(pid < 1)
return -EAGAIN;
return 0;

pthread_mutex_lock(&spawn_mutex);
LIST_FOREACH(s, &spawns, link)
Expand Down Expand Up @@ -289,7 +289,7 @@ spawn_reaper(void)
r = spawn_reap(-1, NULL, 0);
if (r == -EAGAIN)
continue;
if (r < 0)
if (r <= 0)
break;
} while (1);
}
Expand Down

0 comments on commit d4f1c10

Please sign in to comment.