From e8ead2057bbbf434aa4a7d426af3c02d89c3aa3b Mon Sep 17 00:00:00 2001 From: Per Cederqvist <ceder@lysator.liu.se> Date: Sun, 13 Jul 2003 11:56:27 +0000 Subject: [PATCH] (go_and_die): Now a Bool, once again. (check_idle_callback): Break out of the loop and return OOP_HALT if go_and_die is true. --- src/server/connections.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/connections.c b/src/server/connections.c index c2e05a17c..e739e2c85 100644 --- a/src/server/connections.c +++ b/src/server/connections.c @@ -1,5 +1,5 @@ /* - * $Id: connections.c,v 0.98 2003/07/13 11:07:24 ceder Exp $ + * $Id: connections.c,v 0.99 2003/07/13 11:56:27 ceder Exp $ * Copyright (C) 1991-2002 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -94,7 +94,7 @@ Connection * active_connection = NULL; * privileges issues a `shutdown', or of lyskomd receives a SIGHUP. * This not an abort: all data is saved before we exit. */ -volatile sig_atomic_t go_and_die = 0; +Bool go_and_die = FALSE; /* * The number of times that the session penalties has been averaged. @@ -907,7 +907,7 @@ check_idle_callback(oop_source *UNUSED(source), is_idle = FALSE; ++penalty_generation; - for (next = queue_first; next != NULL; ) + for (next = queue_first; next != NULL && !go_and_die; ) { c = next; next = next->queue_next; @@ -924,7 +924,8 @@ check_idle_callback(oop_source *UNUSED(source), if (!is_idle) enable_idle_check(); - return OOP_CONTINUE; + /* Check if a client issued a shutdown command. */ + return go_and_die ? OOP_HALT : OOP_CONTINUE; } static void * -- GitLab