changeset 1216:3daff2072bd0

rename killchild to kill_proxy_sighandler
author Matt Johnston <matt@ucc.asn.au>
date Tue, 15 Dec 2015 22:15:44 +0800
parents d058e15ea213
children 980b7ea2c5ef
files cli-main.c
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/cli-main.c	Tue Dec 15 22:09:55 2015 +0800
+++ b/cli-main.c	Tue Dec 15 22:15:44 2015 +0800
@@ -37,7 +37,7 @@
 
 #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 @@
 	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 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 */