util: 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:
Fabiano Fidêncio 2019-12-19 10:16:21 +01:00
parent 09e993a110
commit da3b2509bd
2 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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,