diff svr-main.c @ 1495:0c16b4ccbd54

make signal flags volatile, simplify handling
author Matt Johnston <matt@ucc.asn.au>
date Wed, 14 Feb 2018 23:06:01 +0800
parents 750ec4ec4cbe
children ee7153a05ffc 2d450c1056e3
line wrap: on
line diff
--- a/svr-main.c	Wed Feb 14 00:24:44 2018 +0800
+++ b/svr-main.c	Wed Feb 14 23:06:01 2018 +0800
@@ -188,7 +188,7 @@
 
 		val = select(maxsock+1, &fds, NULL, NULL, NULL);
 
-		if (exitflag) {
+		if (ses.exitflag) {
 			unlink(svr_opts.pidfile);
 			dropbear_exit("Terminated by signal");
 		}
@@ -359,7 +359,7 @@
 /* catch ctrl-c or sigterm */
 static void sigintterm_handler(int UNUSED(unused)) {
 
-	exitflag = 1;
+	ses.exitflag = 1;
 }
 
 /* Things used by inetd and non-inetd modes */