diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-07-28 14:31:52 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-07-28 14:31:52 -0700 |
commit | cafa4376f4761c2d565b2c1deeb7dbfb553d7045 (patch) | |
tree | ff33357314fa5c7ca9f33549b30b82b3ad78f022 | |
parent | 500775eb145372c5dcbc6e9814858d01730900c7 (diff) |
Truncate pid file before writing new pid to it
Prevents trailing garbage in the file if the new pid has fewer digits
than the previous pid.
(Originally reported against Solaris dtlogin as Sun bug 6627150)
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | dm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -910,6 +910,7 @@ StorePid (void) # endif #endif } + ftruncate(pidFd, 0); fprintf (pidFilePtr, "%5ld\n", (long)getpid ()); (void) fflush (pidFilePtr); RegisterCloseOnFork (pidFd); |