]> diplodocus.org Git - nmh/blobdiff - sbr/lock_file.c
Replaced use of ! with || true, for ultimate Bourne shell compatiblity.
[nmh] / sbr / lock_file.c
index 4057c4cfca6a2bde182ff2850b8dcc7544c24a61..9fbcbd78d94dec5320177858f89a58066394dd7e 100644 (file)
@@ -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);