virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the
checks for it completely unnecessary.
Signed-off-by: Fabiano FidĂȘncio <fidencio(a)redhat.com>
---
src/util/virhostdev.c | 3 +--
src/util/virpidfile.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 78e409732a..9b4ea30216 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -182,8 +182,7 @@ virHostdevManagerNew(void)
g_autofree char *rundir = NULL;
mode_t old_umask;
- if (!(rundir = virGetUserRuntimeDirectory()))
- return NULL;
+ rundir = virGetUserRuntimeDirectory();
hostdevMgr->stateDir = g_strdup_printf("%s/hostdevmgr", rundir);
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index 249515aff2..b08e0d8d52 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -488,8 +488,7 @@ virPidFileConstructPath(bool privileged,
}
*pidfile = g_strdup_printf("%s/%s.pid", runstatedir, progname);
} else {
- if (!(rundir = virGetUserRuntimeDirectory()))
- return -1;
+ rundir = virGetUserRuntimeDirectory();
if (virFileMakePathWithMode(rundir, 0700) < 0) {
virReportSystemError(errno,
--
2.24.1