Commit 88180612 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(go_and_die): Now sig_atomic_t instead of Bool.

(do_statistics): New name for former do_sync_db.  New type:
	sig_atomic_t instead of Bool.  All users of do_sync_db updated.
(toploop): Don't call cache_sync when do_statistics is set.
parent dd7acdb8
/*
* $Id: connections.c,v 0.53 1999/01/18 11:55:26 byers Exp $
* $Id: connections.c,v 0.54 1999/04/03 22:06:36 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -36,7 +36,7 @@
#endif
static const char *
rcsid = "$Id: connections.c,v 0.53 1999/01/18 11:55:26 byers Exp $";
rcsid = "$Id: connections.c,v 0.54 1999/04/03 22:06:36 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -62,6 +62,7 @@ USE(rcsid);
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <signal.h>
#include "ldifftime.h"
#include "misc-types.h"
......@@ -101,17 +102,13 @@ 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 Bool go_and_die = FALSE;
volatile sig_atomic_t go_and_die = 0;
/*
* 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.
* The lyskomd server will dump some statistics when it receives a
* SIGUSR1 signal. The signal handler sets the do_statistics flag.
*/
volatile Bool do_sync_db = FALSE;
volatile sig_atomic_t do_statistics = 0;
jmp_buf parse_env;
......@@ -935,17 +932,10 @@ toploop(void)
while ( !go_and_die )
{
if (do_sync_db)
if (do_statistics)
{
/*
* 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 = FALSE;
do_statistics = 0;
}
gettimeofday(&before, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment