summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authornicm <nicm>2018-03-08 08:09:10 +0000
committernicm <nicm>2018-03-08 08:09:10 +0000
commit19f3a5c6120c5d845eb942e67413c03c0c008a87 (patch)
treefbd4fb03833b499bfa23d77394ba5b6365e00a01 /job.c
parent85c48aafffd4e520eea2e598ea199e7b16f787cc (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 'job.c')
-rw-r--r--job.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/job.c b/job.c
index 866e36c7..5cbe31cd 100644
--- a/job.c
+++ b/job.c
@@ -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;