X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a18840ea0d3700cd973e1188f55c27f06984b4fb..2d033e9c995d385fcd69cb604bf8814de4d1ccec:/sbr/lock_file.c diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 4057c4cf..cac80c1b 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); @@ -559,7 +560,7 @@ lockit (struct lockinfo *li) curlock = li->curlock; if ((tmpfile = m_mktemp(li->tmplock, &fd, NULL)) == NULL) { - advise(NULL, "unable to create temporary file in %s", li->tmplock); + inform("unable to create temporary file in %s", li->tmplock); return -1; }