summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-11 08:58:06 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-11 08:58:06 +0000
commite62b19ee0907bea11ce5312c754300df9c61079d (patch)
treebcfb5460d596e579477946a38eee38ccfeced183 /usr.bin/tmux/server.c
parentf8cf00a07d924702c9a159732d7e76711d4e2522 (diff)
Switch run-shell over to queue the command in the background like #().
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index b3bb7b7222a..b57cf4afd7d 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.53 2009/10/11 07:20:16 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.54 2009/10/11 08:58:05 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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 */
+ }
}
}