mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 02:08:30 +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();
|
Daemonize();
|
||||||
}
|
}
|
||||||
if (pidpath) {
|
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);
|
WRITE(fd, ibuf, FormatInt32(ibuf, getpid()) - ibuf);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue