diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-11 08:58:05 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-11 08:58:05 +0000 |
commit | cebc988dd4b8372b84747a132d0e2babaa84e988 (patch) | |
tree | 515132486b20a79f9b481e3da7d40fcd205ab83d /server.c | |
parent | abedfa77daf3b8a815b134e3650bece0bb646631 (diff) |
Switch run-shell over to queue the command in the background like #().
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 */ + } } } |