util: virPidFileAcquirePath: remove waitForLock argument

None of the callers need it anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2023-03-07 14:49:33 +01:00
parent f64e90346f
commit d3d16f829b
6 changed files with 9 additions and 11 deletions

View 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;
}

View 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;
}

View 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;
}

View 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) {

View 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();

View 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,