summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
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 */
+ }
}
}