[libvirt] [PATCH] Fix virsh command 'cd'.

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

 



cmdCd was returning a 0 on success and -1 on error, when
the rest of the code expected a TRUE on success and a
FALSE on error.  Fix the discrepancy.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
---
 tools/virsh.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index a47edd5..c6e3f2a 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -7469,7 +7469,7 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
 
     if (!ctl->imode) {
         vshError(ctl, "%s", _("cd: command valid only in interactive mode"));
-        return -1;
+        return FALSE;
     }
 
     dir = vshCommandOptString(cmd, "dir", &found);
@@ -7482,10 +7482,10 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
 
     if (chdir (dir) == -1) {
         vshError(ctl, _("cd: %s: %s"), strerror(errno), dir);
-        return -1;
+        return FALSE;
     }
 
-    return 0;
+    return TRUE;
 }
 
 #endif
-- 
1.6.6.1

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