diff options
| author | Richard M. Stallman | 1997-07-30 19:45:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-30 19:45:01 +0000 |
| commit | c6c0c4b1771d27f538f93ae1d6deb522862c10bd (patch) | |
| tree | 771591c93183fa18f4865b7390026dffdf506872 /src | |
| parent | 916848d8bde480a741d745003e8ea4ad55026538 (diff) | |
| download | emacs-c6c0c4b1771d27f538f93ae1d6deb522862c10bd.tar.gz emacs-c6c0c4b1771d27f538f93ae1d6deb522862c10bd.zip | |
(lock_if_free): Don't loop; for strange error, return -1.
Diffstat (limited to 'src')
| -rw-r--r-- | src/filelock.c | 7 |
1 files 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) | |||
| 278 | lock_info_type *clasher; | 278 | lock_info_type *clasher; |
| 279 | register char *lfname; | 279 | register char *lfname; |
| 280 | { | 280 | { |
| 281 | while (lock_file_1 (lfname, 0) == 0) | 281 | if (lock_file_1 (lfname, 0) == 0) |
| 282 | { | 282 | { |
| 283 | int locker; | 283 | int locker; |
| 284 | 284 | ||
| @@ -293,11 +293,8 @@ lock_if_free (clasher, lfname) | |||
| 293 | } | 293 | } |
| 294 | else if (locker == 1) | 294 | else if (locker == 1) |
| 295 | return 1; /* Someone else has it. */ | 295 | return 1; /* Someone else has it. */ |
| 296 | else if (locker == -1) | ||
| 297 | return -1; /* Something's wrong. */ | ||
| 298 | 296 | ||
| 299 | /* If some other error, or no such lock, try to lock again. */ | 297 | return -1; /* Something's wrong. */ |
| 300 | /* Is there a case where we loop forever? */ | ||
| 301 | } | 298 | } |
| 302 | return 0; | 299 | return 0; |
| 303 | } | 300 | } |