summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-18 07:45:24 -0700
committerKeith Packard <keithp@keithp.com>2011-10-18 07:45:24 -0700
commitc8413362049cee8c30e0a9d67f78f9ebefe8e71f (patch)
treecfbc2f1d1fc70887ad4afe41c9045b99d0f954ac /os
parent64d2d1bef14c7ec7156bb3aae64eff69f9f7be54 (diff)
parentb67581cf825940fdf52bf2e0af4330e695d724a4 (diff)
Merge remote-tracking branch 'herrb/master'
Diffstat (limited to 'os')
-rw-r--r--os/utils.c4
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);