changeset 19046:689f3dc973f9

(lock_if_free): Don't loop; for strange error, return -1.
author Richard M. Stallman <rms@gnu.org>
date Wed, 30 Jul 1997 19:45:01 +0000
parents 59ccb8fd4ee1
children f90d40b0bff5
files src/filelock.c
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelock.c	Wed Jul 30 19:44:31 1997 +0000
+++ b/src/filelock.c	Wed Jul 30 19:45:01 1997 +0000
@@ -278,7 +278,7 @@
      lock_info_type *clasher;
      register char *lfname; 
 {
-  while (lock_file_1 (lfname, 0) == 0)
+  if (lock_file_1 (lfname, 0) == 0)
     {
       int locker;
 
@@ -293,11 +293,8 @@
         }
       else if (locker == 1)
         return 1;  /* Someone else has it.  */
-      else if (locker == -1)
-        return -1; /* Something's wrong.  */
 
-       /* If some other error, or no such lock, try to lock again.  */
-       /* Is there a case where we loop forever?  */
+      return -1; /* Something's wrong.  */
     }
   return 0;
 }