Fixed strange bug that prevented a lock from ever being obtained if getting
authorJon Steinhart <jon@fourwinds.com>
Tue, 12 Oct 2004 20:40:25 +0000 (20:40 +0000)
committerJon Steinhart <jon@fourwinds.com>
Tue, 12 Oct 2004 20:40:25 +0000 (20:40 +0000)
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

index 6deddd4..cda66ab 100644 (file)
@@ -401,6 +401,7 @@ lkopen_dot (char *file, int access, mode_t mode)
                else
                    sleep (5);
            }
+           lockname (file, &lkinfo, 1);
        }
     }
 #else