From 97ed2f59856a0bbb0929b4e718378f60876adbab Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Tue, 24 Sep 2002 20:12:11 +0000 Subject: [PATCH] Updated removing directory locks --- mbfido/dirlock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mbfido/dirlock.c b/mbfido/dirlock.c index 9adbdd3f..9f32967b 100644 --- a/mbfido/dirlock.c +++ b/mbfido/dirlock.c @@ -130,7 +130,9 @@ void ulockdir(char *directory) sprintf(lockfile + strlen(lockfile), "%s", LCKNAME); if ((fp = fopen(lockfile, "r")) == NULL) { - Syslog('-', "Lockfile \"%s\" doesn't exist", lockfile); + /* + * No lockfile found, so not removed. + */ free(lockfile); return; } @@ -141,6 +143,9 @@ void ulockdir(char *directory) if (getpid() != oldpid) { WriteError("Attempt to remove lock %s of pid %d", lockfile, oldpid); } else { + /* + * Only remove our own lock. + */ unlink(lockfile); } }