summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/job.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-03-08 08:09:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-03-08 08:09:11 +0000
commite87803d86d8cdec8de078a2eeee905149dfa1f70 (patch)
tree7f0585a1f3e2af7ca0dd745da10443cc846eefbb /usr.bin/tmux/job.c
parent37d8a41c4989cb786999f0e17af7bb32db8cfdcc (diff)
Add a missing client-detached hook when the server shuts down, and do
not exit until jobs started from run-shell/if-shell have finished (add a job flags member and a flag to indicate other jobs). GitHub issue 1245.
Diffstat (limited to 'usr.bin/tmux/job.c')
-rw-r--r--usr.bin/tmux/job.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c
index 37e111b0c0e..b47655e3d89 100644
--- a/usr.bin/tmux/job.c
+++ b/usr.bin/tmux/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.48 2017/07/14 18:49:07 nicm Exp $ */
+/* $OpenBSD: job.c,v 1.49 2018/03/08 08:09:10 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -44,7 +44,7 @@ struct joblist all_jobs = LIST_HEAD_INITIALIZER(all_jobs);
struct job *
job_run(const char *cmd, struct session *s, const char *cwd,
job_update_cb updatecb, job_complete_cb completecb, job_free_cb freecb,
- void *data)
+ void *data, int flags)
{
struct job *job;
struct environ *env;
@@ -111,6 +111,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
job = xmalloc(sizeof *job);
job->state = JOB_RUNNING;
+ job->flags = flags;
job->cmd = xstrdup(cmd);
job->pid = pid;