提交 0e620e66 编写于 作者: P Peter Krempa

lock_daemon: Simplify error handling

No need to check the run_dir variable twice for NULL.
上级 da5a8aee
...@@ -1311,19 +1311,16 @@ int main(int argc, char **argv) { ...@@ -1311,19 +1311,16 @@ int main(int argc, char **argv) {
/* Ensure the rundir exists (on tmpfs on some systems) */ /* Ensure the rundir exists (on tmpfs on some systems) */
if (privileged) { if (privileged) {
run_dir = strdup(LOCALSTATEDIR "/run/libvirt"); if (!(run_dir = strdup(LOCALSTATEDIR "/run/libvirt"))) {
virReportOOMError();
goto cleanup;
}
} else { } else {
run_dir = virGetUserRuntimeDirectory(); if (!(run_dir = virGetUserRuntimeDirectory())) {
if (!run_dir) {
VIR_ERROR(_("Can't determine user directory")); VIR_ERROR(_("Can't determine user directory"));
goto cleanup; goto cleanup;
} }
} }
if (!run_dir) {
virReportOOMError();
goto cleanup;
}
if (privileged) if (privileged)
old_umask = umask(022); old_umask = umask(022);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册