Merge remote-tracking branch 'herrb/master'

This commit is contained in:
Keith Packard 2011-10-18 07:45:24 -07:00
commit c841336204

View File

@ -297,7 +297,7 @@ LockServer(void)
FatalError("Could not create lock file in %s\n", tmp); FatalError("Could not create lock file in %s\n", tmp);
(void) sprintf(pid_str, "%10ld\n", (long)getpid()); (void) sprintf(pid_str, "%10ld\n", (long)getpid());
(void) write(lfd, pid_str, 11); (void) write(lfd, pid_str, 11);
(void) chmod(tmp, 0444); (void) fchmod(lfd, 0444);
(void) close(lfd); (void) close(lfd);
/* /*
@ -318,7 +318,7 @@ LockServer(void)
/* /*
* Read the pid from the existing file * Read the pid from the existing file
*/ */
lfd = open(LockFile, O_RDONLY); lfd = open(LockFile, O_RDONLY|O_NOFOLLOW);
if (lfd < 0) { if (lfd < 0) {
unlink(tmp); unlink(tmp);
FatalError("Can't read lock file %s\n", LockFile); FatalError("Can't read lock file %s\n", LockFile);