interface: 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:39:32 +01:00
parent 7dd205c74b
commit ac5a58dad6
2 changed files with 2 additions and 4 deletions

View File

@ -105,8 +105,7 @@ netcfStateInitialize(bool privileged,
} else { } else {
g_autofree char *rundir = NULL; g_autofree char *rundir = NULL;
if (!(rundir = virGetUserRuntimeDirectory())) rundir = virGetUserRuntimeDirectory();
goto error;
driver->stateDir = g_strdup_printf("%s/interface/run", rundir); driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
} }

View File

@ -1160,8 +1160,7 @@ udevStateInitialize(bool privileged,
} else { } else {
g_autofree char *rundir = NULL; g_autofree char *rundir = NULL;
if (!(rundir = virGetUserRuntimeDirectory())) rundir = virGetUserRuntimeDirectory();
goto cleanup;
driver->stateDir = g_strdup_printf("%s/interface/run", rundir); driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
} }