mbfido lockfile destroy fix

This commit is contained in:
Michiel Broek 2002-04-08 19:09:38 +00:00
parent 882f2af32c
commit 3e03d3bbea
2 changed files with 5 additions and 1 deletions

View File

@ -4701,6 +4701,8 @@ v0.33.20 10-Feb-2002
The tic file forward function now uses only filenames in the The tic file forward function now uses only filenames in the
subject of the netmail messages without the path. subject of the netmail messages without the path.
The tic file forward netmails now uses template forward.tic The tic file forward netmails now uses template forward.tic
When started a second time it doesn't destroy the lockfile
anymore.
mball: mball:
Will not crash anymore when it needs more then 10 minutes to Will not crash anymore when it needs more then 10 minutes to

View File

@ -46,6 +46,7 @@
static char lockfile[81]; static char lockfile[81];
extern int do_quiet; extern int do_quiet;
static int is_locked = FALSE;
/* /*
@ -72,6 +73,7 @@ int lockunpack(void)
while (1) { while (1) {
if (link(Tmpfile, lockfile) == 0) { if (link(Tmpfile, lockfile) == 0) {
unlink(Tmpfile); unlink(Tmpfile);
is_locked = TRUE;
return 0; return 0;
} }
if ((fp = fopen(lockfile, "r")) == NULL) { if ((fp = fopen(lockfile, "r")) == NULL) {
@ -108,7 +110,7 @@ int lockunpack(void)
void ulockunpack(void) void ulockunpack(void)
{ {
if (lockfile) if (is_locked && lockfile)
(void)unlink(lockfile); (void)unlink(lockfile);
} }