Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
spawn: fix spawn_reaper - handle errors
  • Loading branch information
perexg committed Apr 23, 2015
1 parent 926e04e commit 98464be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/spawn.c
Expand Up @@ -283,7 +283,15 @@ spawn_reap(pid_t wpid, char *stxt, size_t stxtlen)
static void
spawn_reaper(void)
{
while (spawn_reap(-1, NULL, 0) != -EAGAIN) ;
int r;

do {
r = spawn_reap(-1, NULL, 0);
if (r == -EAGAIN)
continue;
if (r < 0)
break;
} while (1);
}

/**
Expand Down

0 comments on commit 98464be

Please sign in to comment.