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,