[PATCH 03/23] virsh: doSave: Use if-else instead of ternary operator

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-domain.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4c90f40f86..607eb973ac 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -4213,6 +4213,7 @@ doSave(void *opaque)
     unsigned int flags = 0;
     const char *xmlfile = NULL;
     g_autofree char *xml = NULL;
+    int rc;
 #ifndef WIN32
     sigset_t sigmask, oldsigmask;

@@ -4244,9 +4245,13 @@ doSave(void *opaque)
         goto out;
     }

-    if (((flags || xml)
-         ? virDomainSaveFlags(dom, to, xml, flags)
-         : virDomainSave(dom, to)) < 0) {
+    if (flags || xml) {
+        rc = virDomainSaveFlags(dom, to, xml, flags);
+    } else {
+        rc = virDomainSave(dom, to);
+    }
+
+    if (rc < 0) {
         vshError(ctl, _("Failed to save domain '%s' to %s"), name, to);
         goto out;
     }
-- 
2.35.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