Commit 76030025 authored by inge's avatar inge
Browse files

Made saving of text-stats more efficient.

parent a2784057
Wed Aug 12 00:33:55 1992 Inge Wallin (inge@lysator)
* simple-cache.c(save_one_text): Write texts to file as long as
they are removed.
Thu Jun 11 16:28:39 1992 Per Cederqvist (ceder@lysator)
* vercion.incl: Version 1.2.3.
......
/*
* $Id: simple-cache.c,v 0.23 1992/06/11 19:16:47 ceder Exp $
* $Id: simple-cache.c,v 0.24 1992/08/11 22:35:56 inge Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
* New save algorithm by ceder.
*/
static char *rcsid = "$Id: simple-cache.c,v 0.23 1992/06/11 19:16:47 ceder Exp $";
static char *rcsid = "$Id: simple-cache.c,v 0.24 1992/08/11 22:35:56 inge Exp $";
......@@ -1509,7 +1509,7 @@ save_one_text(void)
long offset;
long offset2;
if (sync_next < highest_text_no)
while (sync_next < highest_text_no)
{
cn = get_text_node(sync_next);
......@@ -1517,6 +1517,9 @@ save_one_text(void)
{
putc('@', file_b);
putc('\n', file_b);
sync_next++;
continue;
}
else
{
......@@ -1541,10 +1544,14 @@ save_one_text(void)
putc('\n', file_b);
cn->size_b = ftell(file_b) - cn->pos_b;
sync_next++;
break;
}
sync_next++;
}
else /* All texts are written. */
/* If all texts are written, do some clean-up. */
if (sync_next == highest_text_no)
{
if ( ferror(file_b) != 0 )
{
......
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