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

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