changeset 24768:0895c669be5e

(lock_if_free): After deleting a stale lock, try again to lock the file.
author Richard M. Stallman <rms@gnu.org>
date Mon, 24 May 1999 09:19:06 +0000
parents 8f4601c1e4e5
children 28aea9fa43e1
files src/filelock.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelock.c	Mon May 24 09:03:05 1999 +0000
+++ b/src/filelock.c	Mon May 24 09:19:06 1999 +0000
@@ -521,7 +521,7 @@
      lock_info_type *clasher;
      register char *lfname; 
 {
-  if (lock_file_1 (lfname, 0) == 0)
+  while (lock_file_1 (lfname, 0) == 0)
     {
       int locker;
 
@@ -537,7 +537,7 @@
       else if (locker == 1)
         return 1;  /* Someone else has it.  */
 
-      return -1; /* Something's wrong.  */
+      /* We deleted a stale lock; try again to lock the file.  */
     }
   return 0;
 }