]> git.eshelyaron.com Git - emacs.git/commitdiff
(current_lock_owner): Don't try to delete lock
authorRichard M. Stallman <rms@gnu.org>
Thu, 31 Jul 1997 07:54:07 +0000 (07:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 31 Jul 1997 07:54:07 +0000 (07:54 +0000)
if this or another existing process owns it!

src/filelock.c

index b79bccc65a5ab4852250adbc0ae830ffbcded76a..6116b89fd96623f04c4766bb7e59b2ff2c8d0dcf 100644 (file)
@@ -240,17 +240,15 @@ current_lock_owner (owner, lfname)
     {
       if (owner->pid == getpid ())
         ret = 2; /* We own it.  */
-      
-      if (owner->pid > 0
+      else if (owner->pid > 0
                && (kill (owner->pid, 0) >= 0 || errno == EPERM))
         ret = 1; /* An existing process on this machine owns it.  */
-      
       /* The owner process is dead or has a strange pid (<=0), so try to
          zap the lockfile.  */
-      if (unlink (lfname) < 0)
+      else if (unlink (lfname) < 0)
         ret = -1;
-      
-      ret = 0;
+      else
+       ret = 0;
     }
   else
     { /* If we wanted to support the check for stale locks on remote machines,