Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
ba968192
Commit
ba968192
authored
Jul 27, 1996
by
David Byers
Browse files
(init_cache): Data file is now terminated by EOF, not a dollar sign.
parent
fefaf689
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/simple-cache.c
View file @
ba968192
/*
* $Id: simple-cache.c,v 0.5
5
1996/07/2
6 01:50:12 ced
er Exp $
* $Id: simple-cache.c,v 0.5
6
1996/07/2
7 11:16:33 by
er
s
Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -33,17 +33,19 @@
* New save algorithm by ceder.
*/
static
char
*
rcsid
=
"$Id: simple-cache.c,v 0.5
5
1996/07/2
6 01:50:12 ced
er Exp $"
;
static
char
*
rcsid
=
"$Id: simple-cache.c,v 0.5
6
1996/07/2
7 11:16:33 by
er
s
Exp $"
;
#include
"rcs.h"
USE
(
rcsid
);
#include
<errno.h>
#include
<stdio.h>
#include
<sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#include
<unistd.h>
#ifndef SEEK_END
# include <fcntl.h>
#endif
...
...
@@ -1759,12 +1761,12 @@ save_one_text(void)
if
(
cn
->
snap_shot
!=
NULL
)
{
fprintf
(
file_b
,
"T %ld
"
,
sync_next
);
fprintf
(
file_b
,
"T %ld"
,
sync_next
);
foutput_text_stat
(
file_b
,
cn
->
snap_shot
);
}
else
if
(
cn
->
s
.
dirty
==
0
&&
cn
->
ptr
!=
NULL
)
{
fprintf
(
file_b
,
"T %ld
"
,
sync_next
);
fprintf
(
file_b
,
"T %ld"
,
sync_next
);
foutput_text_stat
(
file_b
,
cn
->
ptr
);
}
else
...
...
@@ -2001,7 +2003,7 @@ init_cache(void)
Text_stat
tmp_text
;
long
datafile_version
;
long
pos
,
num
;
char
done
,
read_text_no
,
read_conf_no
;
char
done
,
read_text_no
,
read_conf_no
,
c
;
pers_mcb
=
create_cache_node_mcb
(
100
,
MAX_CONF
);
conf_mcb
=
create_cache_node_mcb
(
100
,
MAX_CONF
);
...
...
@@ -2089,8 +2091,12 @@ init_cache(void)
for
(
i
=
1
;
!
done
;
i
++
)
/* CONFS */
{
fskipwhite
(
file_a
);
switch
(
getc
(
file_a
))
switch
(
c
=
getc
(
file_a
))
{
case
EOF
:
done
=
1
;
break
;
case
'@'
:
case
'+'
:
restart_kom
(
"init_cache(): old type record in new type file
\n
"
);
...
...
@@ -2236,12 +2242,9 @@ init_cache(void)
clear_text_stat
(
&
tmp_text
);
break
;
case
'$'
:
done
=
1
;
break
;
default:
restart_kom
(
"init_cache(): Unknown key in data file
\n
"
);
restart_kom
(
"init_cache(): Unknown key '%c' in data file
\n
"
,
c
);
break
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment