Lines 297-303
LockServer(void)
Link Here
|
297 |
FatalError("Could not create lock file in %s\n", tmp); |
297 |
FatalError("Could not create lock file in %s\n", tmp); |
298 |
(void) sprintf(pid_str, "%10ld\n", (long)getpid()); |
298 |
(void) sprintf(pid_str, "%10ld\n", (long)getpid()); |
299 |
(void) write(lfd, pid_str, 11); |
299 |
(void) write(lfd, pid_str, 11); |
300 |
(void) chmod(tmp, 0444); |
300 |
(void) fchmod(lfd, 0444); |
301 |
(void) close(lfd); |
301 |
(void) close(lfd); |
302 |
/* |
302 |
/* |
Lines 318-324
LockServer(void)
Link Here
|
318 |
/* |
318 |
/* |
319 |
* Read the pid from the existing file |
319 |
* Read the pid from the existing file |
320 |
*/ |
320 |
*/ |
321 |
lfd = open(LockFile, O_RDONLY); |
321 |
lfd = open(LockFile, O_RDONLY|O_NOFOLLOW); |
322 |
if (lfd < 0) { |
322 |
if (lfd < 0) { |
323 |
unlink(tmp); |
323 |
unlink(tmp); |
324 |
FatalError("Can't read lock file %s\n", LockFile); |
324 |
FatalError("Can't read lock file %s\n", LockFile); |