[PATCH] rpc: reformat the flow to make a bit more sense

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/rpc/virnetsocket.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 586a0d7..42184bd 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -574,13 +574,14 @@ int virNetSocketNewConnectUNIX(const char *path,

  retry:
     if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) {
+        int status = 0;
+        pid_t pid = 0;
+
         if (!spawnDaemon) {
             virReportSystemError(errno, _("Failed to connect socket to '%s'"),
                                  path);
             goto error;
-        } else {
-            int status = 0;
-            pid_t pid = 0;
+        }

         if ((passfd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
             virReportSystemError(errno, "%s", _("Failed to create socket"));
@@ -634,7 +635,6 @@ int virNetSocketNewConnectUNIX(const char *path,
         if (virNetSocketForkDaemon(binary, passfd) < 0)
             goto error;
     }
-    }

     localAddr.len = sizeof(localAddr.data);
     if (getsockname(fd, &localAddr.data.sa, &localAddr.len) < 0) {
--
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]