From 8fa62d4f0962cba060ad8da1fc86b25b571c71d1 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 1 Nov 2009 23:20:37 +0000 Subject: 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 #(). --- usr.bin/tmux/cmd-if-shell.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'usr.bin/tmux/cmd-if-shell.c') diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c index 67d573b02ab..190bc65e8cb 100644 --- a/usr.bin/tmux/cmd-if-shell.c +++ b/usr.bin/tmux/cmd-if-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-if-shell.c,v 1.5 2009/10/11 09:10:57 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.6 2009/11/01 23:20:37 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -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) { -- cgit v1.2.3-59-g8ed1b