Skip to content
GitLab
Menu
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
c1f8a458
Commit
c1f8a458
authored
Mar 23, 1992
by
Per Cederqvist
Browse files
Fixed so that dbck can repair a truncated database.
parent
73149fff
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/server/ChangeLog
View file @
c1f8a458
Mon Mar 23 08:51:13 1992 Per Cederqvist (ceder@robin)
* dbck.c (truncated_texts): New variable.
* dbck.c (main): Increase modifications if truncated_texts is set.
* dbck-cache.c (init_cache): If the database is truncated or
severely damaged in the text-status part, just ignore the remaining
texts (and don't fail miserably).
Thu Mar 12 04:30:17 1992 Per Cederqvist (ceder@lysator)
* membership.c (get_unread_confs): You must be logged in to use
...
...
src/server/dbck-cache.c
View file @
c1f8a458
/*
* $Id: dbck-cache.c,v 0.
9
1992/0
2
/2
6 18:45:15
ceder Exp $
* $Id: dbck-cache.c,v 0.
10
1992/0
3
/2
3 08:02:50
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -32,7 +32,7 @@
* Also save time as a time_t instead of a struct tm.
*/
static
char
*
rcsid
=
"$Id: dbck-cache.c,v 0.
9
1992/0
2
/2
6 18:45:15
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: dbck-cache.c,v 0.
10
1992/0
3
/2
3 08:02:50
ceder Exp $"
;
/*
...
...
@@ -644,6 +644,7 @@ init_cache(void)
FILE
*
fp
=
NULL
;
int
i
;
extern
int
vflag
;
/* from dbck.c */
extern
Bool
truncated_texts
;
/* from dbck.c */
new_text_file
=
NULL
;
...
...
@@ -748,8 +749,17 @@ init_cache(void)
case
'+'
:
text_arr
[
i
]
=
alloc_text_stat
();
if
(
fparse_text_stat
(
fp
,
text_arr
[
i
])
!=
OK
)
restart_kom
(
"init_cache(): fparse_text_stat failed. i == %d
\n
"
,
i
);
{
/* Simply ignore the following texts. The cause of this
error might be that the file has been truncated (maybe
due to an overfull disk). */
log
(
"init_cache(): fparse_text_stat failed for text %d.
\n
"
"All remaining texts are lost.
\n
"
,
i
);
next_text_num
=
i
;
truncated_texts
=
TRUE
;
}
break
;
}
}
...
...
src/server/dbck.c
View file @
c1f8a458
/*
* $Id: dbck.c,v 0.
9
1992/0
2
/2
6 18:45:13
ceder Exp $
* $Id: dbck.c,v 0.
10
1992/0
3
/2
3 08:02:42
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -28,7 +28,7 @@
* Author: Per Cederqvist.
*/
static
char
*
rcsid
=
"$Id: dbck.c,v 0.
9
1992/0
2
/2
6 18:45:13
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: dbck.c,v 0.
10
1992/0
3
/2
3 08:02:42
ceder Exp $"
;
#include
<stdarg.h>
...
...
@@ -46,6 +46,10 @@ static char *rcsid = "$Id: dbck.c,v 0.9 1992/02/26 18:45:13 ceder Exp $";
#include
<debug.h>
#include
"dbck-cache.h"
/* This is set to TRUE if init_cache finds out that the last part of the
database is missing. */
Bool
truncated_texts
=
FALSE
;
char
datafilename
[
1024
];
/* Full pathname to the database file */
char
backupfilename
[
1024
];
/* Full pathname to the backup file */
char
textfilename
[
1024
];
...
...
@@ -1246,6 +1250,10 @@ main (int argc,
init_data_base
();
errors
=
check_data_base
();
if
(
truncated_texts
==
TRUE
)
modifications
++
;
if
(
iflag
)
log
(
"Total of %d error%s remains.
\n
"
,
errors
,
errors
==
1
?
""
:
"s"
);
else
if
(
vflag
&&
errors
>
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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