summaryrefslogtreecommitdiffstats
path: root/cmd-if-shell.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-11-02 21:38:27 +0000
committerTiago Cunha <tcunha@gmx.com>2009-11-02 21:38:27 +0000
commit053e40572c32d021ad8bd2922c97c5e6dcbe2c81 (patch)
tree90363ff5fecbb52e5f6ee2af5a47af93765c974d /cmd-if-shell.c
parent47f69075a0d9abf031585eb86bea1646a3bf32eb (diff)
Sync OpenBSD patchset 475:
Add a flag for jobs that shouldn't be freed after they've died and use it for status jobs, then only kill those jobs when status-left, status-right or set-titles-string is changed. Fixes problems with changing options from inside #().
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r--cmd-if-shell.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index 2ef4f7a3..10c2f1d6 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-if-shell.c,v 1.6 2009-10-12 00:29:03 tcunha Exp $ */
+/* $Id: cmd-if-shell.c,v 1.7 2009-11-02 21:38:26 tcunha Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -65,7 +65,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_ctx *ctx)
if (ctx->curclient != NULL)
ctx->curclient->references++;
- job = job_add(NULL, NULL,
+ job = job_add(NULL, 0, NULL,
data->arg, cmd_if_shell_callback, cmd_if_shell_free, cdata);
job_run(job);
@@ -80,10 +80,8 @@ cmd_if_shell_callback(struct job *job)
struct cmd_list *cmdlist;
char *cause;
- if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0) {
- job_free(job); /* calls cmd_if_shell_free */
+ if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0)
return;
- }
if (cmd_string_parse(cdata->cmd, &cmdlist, &cause) != 0) {
if (cause != NULL) {