transfused: if the pidfile exists, make sure to truncate it

This commit is contained in:
David Sheets 2016-02-12 11:46:44 +00:00
parent cbd5ca5991
commit b1d3101846

View File

@ -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);