From 2527c282c378f7401c0adb80221b691582b84989 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 11 Mar 2014 11:18:07 +0100 Subject: [PATCH] exec: implement options -signal/-kill/-killall in command /exec --- src/plugins/exec/exec-command.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index 0f07e02c6..016541e3f 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -218,9 +218,7 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_ERROR; ptr_exec_cmd = exec_command_search_running_id (argv[2]); if (ptr_exec_cmd) - { - /* TODO: send signal to the process */ - } + weechat_hook_set (ptr_exec_cmd->hook, "signal", argv[3]); return WEECHAT_RC_OK; } @@ -231,9 +229,7 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_ERROR; ptr_exec_cmd = exec_command_search_running_id (argv[2]); if (ptr_exec_cmd) - { - /* TODO: send KILL signal to the process */ - } + weechat_hook_set (ptr_exec_cmd->hook, "signal", "kill"); return WEECHAT_RC_OK; } @@ -243,7 +239,10 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc, for (ptr_exec_cmd = exec_cmds; ptr_exec_cmd; ptr_exec_cmd = ptr_exec_cmd->next_cmd) { - /* TODO: send KILL signal to the process */ + if (ptr_exec_cmd->hook) + { + weechat_hook_set (ptr_exec_cmd->hook, "signal", "kill"); + } } return WEECHAT_RC_OK; }