Commit 812375bf authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(sync_output_header): New argument: include_timestamp.

(pre_sync): The header should include a timestamp.
(save_one_text): The header should not include a timestamp when the
	"CLEAN" marker is written.  We want the timestamp in the file
	to be the time when the snapshot was taken.
parent 625c183e
/*
* $Id: simple-cache.c,v 0.113 2003/08/23 16:38:13 ceder Exp $
* $Id: simple-cache.c,v 0.114 2003/10/04 11:46:39 ceder Exp $
* Copyright (C) 1991-2003 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -1750,10 +1750,11 @@ get_version(const char *fn)
}
static void
sync_output_header(FILE* fp, const char *state)
sync_output_header(FILE* fp, const char *state, int include_timestamp)
{
fprintf(fp, "%s:%05ld\n", state, 2L); /* DIRTY-FLAG and VERSION*/
fprintf(fp, "%020lu\n", (unsigned long)current_time.tv_sec);
if (include_timestamp)
fprintf(fp, "%020lu\n", (unsigned long)current_time.tv_sec);
}
static void
......@@ -1920,7 +1921,7 @@ pre_sync(void)
sync_output_header(file_b, "DIRTY");
sync_output_header(file_b, "DIRTY", 1);
fprintf(file_b, "#C %d\n", highest_conf_no);
fprintf(file_b, "#T %ld\n", highest_text_no);
fprintf(file_b, "I");
......@@ -2355,7 +2356,7 @@ save_one_text(void)
return;
}
sync_output_header(file_b, "CLEAN");
sync_output_header(file_b, "CLEAN", 0);
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