From e1aa1132ef821c2068b7ec7cc20936b63611e051 Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 26 Sep 2014 16:54:25 +0100 Subject: Just flag the signal, nothing more --- ratox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 141953b..78fb665 100644 --- a/ratox.c +++ b/ratox.c @@ -165,7 +165,7 @@ static Tox_Options toxopt; static uint8_t *passphrase; static uint32_t pplen; static uint8_t toilet[BUFSIZ]; -static int running = 1; +static sig_atomic_t running = 1; static int ipv6; static int tcpflag; static int proxyflag; @@ -1296,7 +1296,6 @@ loop(void) static void initshutdown(int sig) { - printout("Shutting down...\n"); running = 0; } @@ -1307,6 +1306,8 @@ shutdown(void) struct friend *f, *ftmp; struct request *r, *rtmp; + printout("Shutting down...\n"); + /* Friends */ for (f = TAILQ_FIRST(&friendhead); f; f = ftmp) { ftmp = TAILQ_NEXT(f, entry); -- cgit v1.2.3