mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
lock_daemon: Simplify error handling
No need to check the run_dir variable twice for NULL.
This commit is contained in:
parent
da5a8aee2b
commit
0e620e6669
@ -1311,19 +1311,16 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* Ensure the rundir exists (on tmpfs on some systems) */
|
||||
if (privileged) {
|
||||
run_dir = strdup(LOCALSTATEDIR "/run/libvirt");
|
||||
if (!(run_dir = strdup(LOCALSTATEDIR "/run/libvirt"))) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
run_dir = virGetUserRuntimeDirectory();
|
||||
|
||||
if (!run_dir) {
|
||||
if (!(run_dir = virGetUserRuntimeDirectory())) {
|
||||
VIR_ERROR(_("Can't determine user directory"));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
if (!run_dir) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (privileged)
|
||||
old_umask = umask(022);
|
||||
|
Loading…
Reference in New Issue
Block a user