Commit b5cceb74 authored by Keith Packard's avatar Keith Packard Committed by Mike Gabriel

os: Make sure that writing our pid to the lock file actually worked

There's no sense verifying that we can create the lock file and then ignoring the return value from write. Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net> Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
parent bad0e8bd
......@@ -411,7 +411,9 @@ LockServer(void)
if (lfd < 0)
FatalError("Could not create lock file in %s\n", tmp);
(void) sprintf(pid_str, "%10ld\n", (long)getpid());
(void) write(lfd, pid_str, 11);
if (write(lfd, pid_str, 11) != 11)
FatalError("Could not write pid to lock file in %s\n", tmp);
#ifndef __UNIXOS2__
#ifndef USE_CHMOD
(void) fchmod(lfd, 0444);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment