diff options
author | nicm <nicm> | 2020-06-12 10:31:12 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-06-12 10:31:12 +0000 |
commit | d52ac7d027e40b34e7089addc4f905d03d9c1b16 (patch) | |
tree | c7d763fa1490a9d8703a0566450ab56772d6c054 /cmd-run-shell.c | |
parent | d8d77691043a5ecd504fb2a82e4e312d947ab19f (diff) | |
download | rtmux-d52ac7d027e40b34e7089addc4f905d03d9c1b16.tar.gz rtmux-d52ac7d027e40b34e7089addc4f905d03d9c1b16.tar.bz2 rtmux-d52ac7d027e40b34e7089addc4f905d03d9c1b16.zip |
Do not wait on shutdown for commands started with run -b.
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r-- | cmd-run-shell.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 3792aaae..647f533f 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -56,6 +56,7 @@ struct cmd_run_shell_data { struct session *s; int wp_id; struct event timer; + int flags; }; static void @@ -110,6 +111,8 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) if (!args_has(args, 'b')) cdata->item = item; + else + cdata->flags |= JOB_NOWAIT; cdata->cwd = xstrdup(server_client_get_cwd(cmdq_get_client(item), s)); cdata->s = s; @@ -144,8 +147,8 @@ cmd_run_shell_timer(__unused int fd, __unused short events, void* arg) if (cdata->cmd != NULL) { if (job_run(cdata->cmd, cdata->s, cdata->cwd, NULL, - cmd_run_shell_callback, cmd_run_shell_free, cdata, 0, -1, - -1) == NULL) + cmd_run_shell_callback, cmd_run_shell_free, cdata, + cdata->flags, -1, -1) == NULL) cmd_run_shell_free(cdata); } else { if (cdata->item != NULL) |