From 6bf64e979dfdeac8556d55cd8f1b4ea8f839c967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 3 Apr 2014 09:19:30 +0200 Subject: exec: display command output even if process is killed --- src/plugins/exec/exec.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index a91e52e62..5d8eccbea 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -516,12 +516,6 @@ exec_process_cb (void *data, const char *command, int return_code, (err) ? strlen (err) : 0); } - if (return_code == WEECHAT_HOOK_PROCESS_ERROR) - { - exec_end_command (ptr_exec_cmd, -1); - return WEECHAT_RC_OK; - } - if (out) { exec_concat_output (&ptr_exec_cmd->out_size, @@ -535,7 +529,9 @@ exec_process_cb (void *data, const char *command, int return_code, err); } - if (return_code >= 0) + if (return_code == WEECHAT_HOOK_PROCESS_ERROR) + exec_end_command (ptr_exec_cmd, -1); + else if (return_code >= 0) exec_end_command (ptr_exec_cmd, return_code); return WEECHAT_RC_OK; -- cgit v1.2.3