Commit c6c0c4b1 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(lock_if_free): Don't loop; for strange error, return -1.

parent 916848d8
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment