mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-02 07:23:52 +00:00
transfused: if the pidfile exists, make sure to truncate it
This commit is contained in:
parent
321ee6b30f
commit
b36faade61
@ -440,7 +440,7 @@ void write_pidfile(char * pidfile) {
|
|||||||
|
|
||||||
pid_s_len = strlen(pid_s);
|
pid_s_len = strlen(pid_s);
|
||||||
|
|
||||||
fd = open(pidfile, O_WRONLY | O_CREAT, 0644);
|
fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
die(1, "", "Couldn't open pidfile path %s: ", pidfile);
|
die(1, "", "Couldn't open pidfile path %s: ", pidfile);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user