[PATCH 6/6] qemuMonitorOpenUnix: Don't overwrite 'ret' needlessly

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

 



Directly check the return value of 'connect'. Unfortunately we can't
remove it as we have to undo auto-closing of the socket on success.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index ad5e121359..0c0b07d4a5 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -245,8 +245,7 @@ qemuMonitorOpenUnix(const char *monitor)
         return -1;
     }

-    ret = connect(monfd, (struct sockaddr *) &addr, sizeof(addr));
-    if (ret < 0) {
+    if (connect(monfd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
         virReportSystemError(errno, "%s",
                              _("failed to connect to monitor socket"));
         return -1;
-- 
2.36.1




[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]

  Powered by Linux