From 3162c1b16d85ce6590bb839fd25378a28c005afc Mon Sep 17 00:00:00 2001 From: Jon Steinhart Date: Tue, 12 Oct 2004 20:40:25 +0000 Subject: [PATCH] Fixed strange bug that prevented a lock from ever being obtained if getting it failed the first time. The problem was that the string of XXXXXX that is required by mkstemp() was overwritten the first time through, and so all subsequent times failed because mkstemp() failed. The fix reinitializes the tmp file string. --- sbr/lock_file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 6deddd4..cda66ab 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -401,6 +401,7 @@ lkopen_dot (char *file, int access, mode_t mode) else sleep (5); } + lockname (file, &lkinfo, 1); } } #else -- 1.7.10.4