From: Richard M. Stallman Date: Wed, 30 Jul 1997 19:45:01 +0000 (+0000) Subject: (lock_if_free): Don't loop; for strange error, return -1. X-Git-Tag: emacs-20.1~900 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c6c0c4b1771d27f538f93ae1d6deb522862c10bd;p=emacs.git (lock_if_free): Don't loop; for strange error, return -1. --- diff --git a/src/filelock.c b/src/filelock.c index 5000f87a615..b79bccc65a5 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -278,7 +278,7 @@ lock_if_free (clasher, lfname) 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 @@ lock_if_free (clasher, lfname) } 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; }