]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: virPidFileAcquirePath: remove waitForLock argument
authorJán Tomko <jtomko@redhat.com>
Tue, 7 Mar 2023 13:49:33 +0000 (14:49 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 8 Mar 2023 11:16:56 +0000 (12:16 +0100)
None of the callers need it anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/locking/lock_daemon.c
src/logging/log_daemon.c
src/remote/remote_daemon.c
src/util/vircommand.c
src/util/virpidfile.c
src/util/virpidfile.h

index 5eed6b7c26e534455fb079a3e886a432c5a0a239..6b0a8220e5d05d0b675e9be759fc153c78273dbf 100644 (file)
@@ -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;
         }
index 80252453501c21eebe46262de0a8c6e26a188ea3..b4db58581094f4d4d9e3ae02ac7e0b11464b05f6 100644 (file)
@@ -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;
         }
index dd9344168bfae1f999e3ca07926d5b3f98a5405b..4f14187bef61a1f1e527c3511abf0b75872667f2 100644 (file)
@@ -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;
     }
index 0917bc9cfb4cf89728586030d7c6aab987cef2a6..1144dfb597461b4aac9b111ad6e20f3be84e0104 100644 (file)
@@ -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) {
index 742531379ec52e24398bb9e34c420bb2a94df8c2..252100cdc3f8904796df17cccd89adbf96fbd1ec 100644 (file)
@@ -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();
 
index 8c70f883be9677a702128a1da9417ca4e1ca24a5..6db0fb843f42b2c9c97deb40a49562ece1c96a10 100644 (file)
@@ -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,