Return an error from pv__write_pidfile() if the final rename() fails.

This commit is contained in:
Andrew Wood
2026-04-05 19:34:00 +01:00
parent c2474f5c33
commit fc23d71226
+2
View File
@@ -114,6 +114,8 @@ static int pv__write_pidfile(opts_t opts)
if (rename(pidfile_tmp_name, opts->pidfile) < 0) {
fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno));
(void) remove(pidfile_tmp_name);
free(pidfile_tmp_name);
return PV_ERROREXIT_REMOTE_OR_PID;
}
free(pidfile_tmp_name);