Switch run-shell over to queue the command in the background like #().

This commit is contained in:
Nicholas Marriott
2009-10-11 08:58:05 +00:00
parent abedfa77da
commit cebc988dd4
4 changed files with 89 additions and 42 deletions

View File

@ -810,13 +810,17 @@ void
server_check_jobs(void)
{
struct job *job;
restart:
SLIST_FOREACH(job, &all_jobs, lentry) {
if (job->flags & JOB_DONE || job->fd != -1 || job->pid != -1)
continue;
if (job->callbackfn != NULL)
job->callbackfn(job);
job->flags |= JOB_DONE;
if (job->callbackfn != NULL) {
job->callbackfn(job);
goto restart; /* could be freed by callback */
}
}
}