From 3e03d3bbeafad3f409b9f9e2a7b9f8418aefcf93 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 8 Apr 2002 19:09:38 +0000 Subject: [PATCH] mbfido lockfile destroy fix --- ChangeLog | 2 ++ mbfido/ulock.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 082f3fce..6747969c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4701,6 +4701,8 @@ v0.33.20 10-Feb-2002 The tic file forward function now uses only filenames in the subject of the netmail messages without the path. The tic file forward netmails now uses template forward.tic + When started a second time it doesn't destroy the lockfile + anymore. mball: Will not crash anymore when it needs more then 10 minutes to diff --git a/mbfido/ulock.c b/mbfido/ulock.c index 491fd208..e35c70f2 100644 --- a/mbfido/ulock.c +++ b/mbfido/ulock.c @@ -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); }