diff options
Diffstat (limited to 'os/utils.c')
-rw-r--r-- | os/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/utils.c b/os/utils.c index e8ecb7193..07cf4c24f 100644 --- a/os/utils.c +++ b/os/utils.c @@ -297,7 +297,7 @@ LockServer(void) FatalError("Could not create lock file in %s\n", tmp); (void) sprintf(pid_str, "%10ld\n", (long)getpid()); (void) write(lfd, pid_str, 11); - (void) chmod(tmp, 0444); + (void) fchmod(lfd, 0444); (void) close(lfd); /* @@ -318,7 +318,7 @@ LockServer(void) /* * Read the pid from the existing file */ - lfd = open(LockFile, O_RDONLY); + lfd = open(LockFile, O_RDONLY|O_NOFOLLOW); if (lfd < 0) { unlink(tmp); FatalError("Can't read lock file %s\n", LockFile); |