Skip to content

Commit

Permalink
Exec plugin: Reset the "PL_RUNNING" if "fork_child()" fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
octo committed Mar 9, 2010
1 parent 6b55544 commit 66c0d62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/exec.c
Expand Up @@ -537,7 +537,13 @@ static void *exec_read_one (void *arg) /* {{{ */

status = fork_child (pl, NULL, &fd, &fd_err);
if (status < 0)
{
/* Reset the "running" flag */
pthread_mutex_lock (&pl_lock);
pl->flags &= ~PL_RUNNING;
pthread_mutex_unlock (&pl_lock);
pthread_exit ((void *) 1);
}
pl->pid = status;

assert (pl->pid != 0);
Expand Down

0 comments on commit 66c0d62

Please sign in to comment.