From 1170f74c492e4da09d1940bc1d509993e42cc8ae Mon Sep 17 00:00:00 2001 From: Per Cederqvist <ceder@lysator.liu.se> Date: Fri, 30 Aug 1991 01:32:50 +0000 Subject: [PATCH] Minor cleanups. --- src/server/connections.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/server/connections.c b/src/server/connections.c index 538f7075a..455b8eb69 100644 --- a/src/server/connections.c +++ b/src/server/connections.c @@ -6,7 +6,7 @@ * Created by Willf|r 31/3-90. Mostly written by ceder. */ -static char *rcsid = "$Id: connections.c,v 0.8 1991/08/28 02:21:52 ceder Exp $"; +static char *rcsid = "$Id: connections.c,v 0.9 1991/08/30 01:32:50 ceder Exp $"; #include <errno.h> @@ -44,7 +44,22 @@ static char *rcsid = "$Id: connections.c,v 0.8 1991/08/28 02:21:52 ceder Exp $"; ISCMCB * kom_server_mcb = NULL; Connection * active_connection = NULL; +/* + * This is set TRUE when the server should be closed. It is checked + * each time around the main loop. It is set if someone with enough + * privileges issues a `shutdown', or of lyskomd receives a SIGHUP. + * This not an abort: all data is saved before we exit. + */ volatile Bool go_and_die = FALSE; + +/* + * Once upon a time the entire database was always held in core, and + * saved to disk when we got a SIGUSR1 signal. Nowadays the server + * keeps track of the time itself and saves at appropriate intervalls. + * It does still write some statistics when it get a SIGUSR1 signal. + * The signal handler sets do_sync_db. The name is retained for + * historical reasons. + */ volatile Bool do_sync_db = FALSE; jmp_buf parse_env; @@ -760,11 +775,15 @@ toploop(void) { if (do_sync_db) { - cache_sync(); /* A noop in diskomd. Actually + /* + * do_sync_db used to save the entire database. Nowadays + * all it does is to print some statistics. + */ + cache_sync(); /* A noop in lyskomd. Actually stops the server and dumps everything in ramkomd. */ dump_statistics(); - do_sync_db = 0; + do_sync_db = FALSE; } gettimeofday(&before, NULL); -- GitLab