diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-12-15 22:15:44 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-12-15 22:15:44 +0800 |
commit | 99bc4f451afc5a7a52e0e798d5b2a990189613fa (patch) | |
tree | 831777ec1b3630738534f6c9da60c8b499887eab | |
parent | 79b43270a70143f97ba58c13cc9d055339b44cbe (diff) |
rename killchild to kill_proxy_sighandler
-rw-r--r-- | cli-main.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -37,7 +37,7 @@ static void cli_dropbear_log(int priority, const char* format, va_list param); #ifdef ENABLE_CLI_PROXYCMD static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out); -static void killchild(int signo); +static void kill_proxy_sighandler(int signo); #endif #if defined(DBMULTI_dbclient) || !defined(DROPBEAR_MULTI) @@ -78,9 +78,9 @@ int main(int argc, char ** argv) { if (cli_opts.proxycmd) { cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid); m_free(cli_opts.proxycmd); - if (signal(SIGINT, killchild) == SIG_ERR || - signal(SIGTERM, killchild) == SIG_ERR || - signal(SIGHUP, killchild) == SIG_ERR) { + if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR || + signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR || + signal(SIGHUP, kill_proxy_sighandler) == SIG_ERR) { dropbear_exit("signal() error"); } } else @@ -164,11 +164,8 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { } } -static void killchild(int signo) { +static void kill_proxy_sighandler(int UNUSED(signo)) { kill_proxy_command(); - if (signo) { - _exit(1); - } - exit(1); + _exit(1); } #endif /* ENABLE_CLI_PROXYCMD */ |