summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-12-15 22:15:44 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-12-15 22:15:44 +0800
commit99bc4f451afc5a7a52e0e798d5b2a990189613fa (patch)
tree831777ec1b3630738534f6c9da60c8b499887eab
parent79b43270a70143f97ba58c13cc9d055339b44cbe (diff)
rename killchild to kill_proxy_sighandler
-rw-r--r--cli-main.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/cli-main.c b/cli-main.c
index 3cfc02d..c2fd729 100644
--- a/cli-main.c
+++ b/cli-main.c
@@ -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 */