]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
remote: Don't check the output of virGetUserRuntimeDirectory()
authorFabiano Fidêncio <fidencio@redhat.com>
Thu, 19 Dec 2019 09:21:40 +0000 (10:21 +0100)
committerFabiano Fidêncio <fidencio@redhat.com>
Fri, 20 Dec 2019 08:38:43 +0000 (09:38 +0100)
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>
src/remote/remote_daemon.c
src/remote/remote_driver.c

index b400b1dd105932012d5680e24dba7308229fbadb..589349287557d90298501bdeeeb0ada84960a049 100644 (file)
@@ -245,8 +245,7 @@ daemonUnixSocketPaths(struct daemonConfig *config,
         } else {
             mode_t old_umask;
 
-            if (!(rundir = virGetUserRuntimeDirectory()))
-                goto cleanup;
+            rundir = virGetUserRuntimeDirectory();
 
             old_umask = umask(077);
             if (virFileMakePath(rundir) < 0) {
@@ -1208,11 +1207,6 @@ int main(int argc, char **argv) {
         run_dir = g_strdup(RUNSTATEDIR "/libvirt");
     } else {
         run_dir = virGetUserRuntimeDirectory();
-
-        if (!run_dir) {
-            VIR_ERROR(_("Can't determine user directory"));
-            goto cleanup;
-        }
     }
     if (privileged)
         old_umask = umask(022);
index e684fcba099aafa416503ea025fefcedfe070efd..c11f73ab4d2d6c527e4b46a67e76c392426eac68 100644 (file)
@@ -779,8 +779,7 @@ remoteGetUNIXSocketHelper(remoteDriverTransport transport,
                            remoteDriverTransportTypeToString(transport));
             return NULL;
         }
-        if (!(userdir = virGetUserRuntimeDirectory()))
-            return NULL;
+        userdir = virGetUserRuntimeDirectory();
 
         sockname = g_strdup_printf("%s/%s-sock", userdir, sock_prefix);
     } else {