In two places where virPidFileForceCleanupPath() is called, we
try to unlink() the pidfile again. This is needless because
virPidFileForceCleanupPath() has done just that.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
if (virPidFileForceCleanupPath(pidfile) < 0) {
VIR_WARN("Unable to kill pr-helper process");
} else {
- if (unlink(pidfile) < 0 &&
- errno != ENOENT) {
- virReportSystemError(errno,
- _("Unable to remove stale pidfile %s"),
- pidfile);
- } else {
- priv->prDaemonRunning = false;
- }
+ priv->prDaemonRunning = false;
}
virErrorRestore(&orig_err);
}
}
virErrorPreserveLast(&orig_err);
- if (virPidFileForceCleanupPath(pidfile) < 0) {
+ if (virPidFileForceCleanupPath(pidfile) < 0)
VIR_WARN("Unable to kill vhost-user-gpu process");
- } else {
- if (unlink(pidfile) < 0 &&
- errno != ENOENT) {
- virReportSystemError(errno,
- _("Unable to remove stale pidfile %s"),
- pidfile);
- }
- }
virErrorRestore(&orig_err);
}