X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a18840ea0d3700cd973e1188f55c27f06984b4fb..2ecaea82a8f9758da5a38cb5df98fbde188d92ba:/sbr/lock_file.c diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 4057c4cf..9fbcbd78 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -495,6 +495,8 @@ lkopen_dot (const char *file, int access, mode_t mode, int *failed_to_lock) { int i; for (i = 0; i < LOCK_RETRIES; ++i) { + struct stat st; + /* attempt to create lock file */ if (lockit (&lkinfo) == 0) { /* if successful, turn on timer and return */ @@ -508,7 +510,6 @@ lkopen_dot (const char *file, int access, mode_t mode, int *failed_to_lock) * we can stat the lockfile but exceed LOCK_RETRIES * seconds waiting for it (by falling out of the loop). */ - struct stat st; if (stat (lkinfo.curlock, &st) == -1) { if (i++ > 5) break; sleep (1);