From c6c0c4b1771d27f538f93ae1d6deb522862c10bd Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 30 Jul 1997 19:45:01 +0000 Subject: [PATCH] (lock_if_free): Don't loop; for strange error, return -1. --- src/filelock.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; } -- 2.39.2