From: Ján Tomko Date: Tue, 7 Mar 2023 13:49:33 +0000 (+0100) Subject: util: virPidFileAcquirePath: remove waitForLock argument X-Git-Tag: v9.2.0-rc1~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3d16f829bf739e3099e8d18c1c9a45b32229eff;p=thirdparty%2Flibvirt.git util: virPidFileAcquirePath: remove waitForLock argument None of the callers need it anymore. Signed-off-by: Ján Tomko Reviewed-by: Martin Kletzander --- diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 5eed6b7c26..6b0a8220e5 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -648,7 +648,7 @@ virLockDaemonPostExecRestart(const char *state_file, /* Re-claim PID file now as we will not be daemonizing */ if (pid_file && - (*pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0) + (*pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) return -1; if (!(lockDaemon = virLockDaemonNewPostExecRestart(object, privileged))) @@ -1000,7 +1000,7 @@ int main(int argc, char **argv) { } /* If we have a pidfile set, claim it now, exiting if already taken */ - if ((pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0) { + if ((pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) { ret = VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 8025245350..b4db585810 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -468,7 +468,7 @@ virLogDaemonPostExecRestart(const char *state_file, /* Re-claim PID file now as we will not be daemonizing */ if (pid_file && - (*pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0) + (*pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) return -1; if (!(logDaemon = virLogDaemonNewPostExecRestart(object, @@ -803,7 +803,7 @@ int main(int argc, char **argv) { } /* If we have a pidfile set, claim it now, exiting if already taken */ - if ((pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0) { + if ((pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) { ret = VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index dd9344168b..4f14187bef 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -990,7 +990,7 @@ int main(int argc, char **argv) { } /* Try to claim the pidfile, exiting if we can't */ - if ((pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0) { + if ((pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) { ret = VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 0917bc9cfb..1144dfb597 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -828,7 +828,7 @@ virExec(virCommand *cmd) int pidfilefd = -1; char c; - pidfilefd = virPidFileAcquirePath(cmd->pidfile, false, pid); + pidfilefd = virPidFileAcquirePath(cmd->pidfile, pid); if (pidfilefd < 0) goto fork_error; if (virSetInherit(pidfilefd, true) < 0) { diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 742531379e..252100cdc3 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -446,10 +446,9 @@ int virPidFileAcquirePathFull(const char *path, int virPidFileAcquirePath(const char *path, - bool waitForLock, pid_t pid) { - return virPidFileAcquirePathFull(path, waitForLock, pid); + return virPidFileAcquirePathFull(path, false, pid); } @@ -465,7 +464,7 @@ int virPidFileAcquire(const char *dir, if (!(pidfile = virPidFileBuildPath(dir, name))) return -ENOMEM; - return virPidFileAcquirePath(pidfile, false, pid); + return virPidFileAcquirePath(pidfile, pid); } @@ -566,7 +565,7 @@ virPidFileForceCleanupPathFull(const char *path, bool group) if (virPidFileReadPath(path, &pid) < 0) return -1; - fd = virPidFileAcquirePath(path, false, 0); + fd = virPidFileAcquirePath(path, 0); if (fd < 0) { virResetLastError(); diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h index 8c70f883be..6db0fb843f 100644 --- a/src/util/virpidfile.h +++ b/src/util/virpidfile.h @@ -60,7 +60,6 @@ int virPidFileAcquirePathFull(const char *path, bool waitForLock, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquirePath(const char *path, - bool waitForLock, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquire(const char *dir, const char *name,