mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
Update pidfile processing to truncate when writing pid (#910)
This commit is contained in:
parent
6e4b9b6515
commit
f92ad74e6b
1 changed files with 1 additions and 1 deletions
|
@ -7407,7 +7407,7 @@ void RedBean(int argc, char *argv[]) {
|
|||
Daemonize();
|
||||
}
|
||||
if (pidpath) {
|
||||
fd = open(pidpath, O_CREAT | O_WRONLY, 0644);
|
||||
fd = open(pidpath, O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||
WRITE(fd, ibuf, FormatInt32(ibuf, getpid()) - ibuf);
|
||||
close(fd);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue