summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-12 00:25:25 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-12 00:25:25 +0000
commit197f8b88bffb5febe691f2442650574f40fe7322 (patch)
tree289cefa2fb7cd539d9d947381e2f21340364b02a /server.c
parentc8d0608369971b7f80d89961fed4ae3d80eb449b (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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/server.c b/server.c
index 4158044e..27ad3d34 100644
--- a/server.c
+++ b/server.c
@@ -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 */
+ }
}
}