diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-10-12 00:25:25 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-10-12 00:25:25 +0000 |
commit | 197f8b88bffb5febe691f2442650574f40fe7322 (patch) | |
tree | 289cefa2fb7cd539d9d947381e2f21340364b02a /server.c | |
parent | c8d0608369971b7f80d89961fed4ae3d80eb449b (diff) |
Sync OpenBSD patchset 384:
Switch run-shell over to queue the command in the background like #().
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.204 2009-10-12 00:21:08 tcunha Exp $ */ +/* $Id: server.c,v 1.205 2009-10-12 00:25:25 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -813,13 +813,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 */ + } } } |