mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
locking: Don't check the output of virGetUserRuntimeDirectory()
virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
53655ba2c9
commit
7dd205c74b
@ -452,8 +452,7 @@ virLockDaemonUnixSocketPaths(bool privileged,
|
||||
g_autofree char *rundir = NULL;
|
||||
mode_t old_umask;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
return -1;
|
||||
rundir = virGetUserRuntimeDirectory();
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(rundir) < 0) {
|
||||
@ -823,8 +822,7 @@ virLockDaemonExecRestartStatePath(bool privileged,
|
||||
g_autofree char *rundir = NULL;
|
||||
mode_t old_umask;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
return -1;
|
||||
rundir = virGetUserRuntimeDirectory();
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(rundir) < 0) {
|
||||
@ -1224,10 +1222,7 @@ int main(int argc, char **argv) {
|
||||
if (privileged) {
|
||||
run_dir = g_strdup(RUNSTATEDIR "/libvirt");
|
||||
} else {
|
||||
if (!(run_dir = virGetUserRuntimeDirectory())) {
|
||||
VIR_ERROR(_("Can't determine user directory"));
|
||||
goto cleanup;
|
||||
}
|
||||
run_dir = virGetUserRuntimeDirectory();
|
||||
}
|
||||
|
||||
if (privileged)
|
||||
|
@ -124,8 +124,7 @@ static char *virLockManagerLockDaemonPath(bool privileged)
|
||||
} else {
|
||||
g_autofree char *rundir = NULL;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
return NULL;
|
||||
rundir = virGetUserRuntimeDirectory();
|
||||
|
||||
path = g_strdup_printf("%s/virtlockd-sock", rundir);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user