Commit 6c9fc396 authored by David Byers's avatar David Byers
Browse files

(init_cache): Call get_version with the right file name. Previously

get_version was always called with the datafile name. Initialize data
file version before using it.
parent 7f039c28
/*
* $Id: simple-cache.c,v 0.59 1996/07/29 00:04:47 ceder Exp $
* $Id: simple-cache.c,v 0.60 1996/08/01 11:32:57 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 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.59 1996/07/29 00:04:47 ceder Exp $";
static char *rcsid = "$Id: simple-cache.c,v 0.60 1996/08/01 11:32:57 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -2007,7 +2007,6 @@ init_cache(void)
conf_mcb = create_cache_node_mcb(100, MAX_CONF);
text_mcb = create_cache_node_mcb(100, MAX_TEXT);
init_conference(&tmp_conf);
init_person(&tmp_pers);
init_text_stat(&tmp_text);
......@@ -2037,6 +2036,8 @@ init_cache(void)
datafile_version = -1;
if ( (text_file = fopen(param.textfile_name, "a+b")) == NULL )
{
restart_kom("%s \"%s\". errno = %d\n",
......@@ -2052,6 +2053,7 @@ init_cache(void)
return FAILURE;
}
log("MSG: init_cache: using datafile.\n");
datafile_version = get_version(param.datafile_name);
}
else if (is_clean(param.backupfile_name))
{
......@@ -2061,6 +2063,7 @@ init_cache(void)
return FAILURE;
}
log("MSG: init_cache: using backup file.\n");
datafile_version = get_version(param.backupfile_name);
}
else
{
......@@ -2068,7 +2071,6 @@ init_cache(void)
return FAILURE;
}
datafile_version = get_version(param.datafile_name);
if (datafile_version != 1)
{
restart_kom("init_cache: Incompatible data file version %ld.\n",
......
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