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

Chris Lalancette clalance at redhat.com
Thu Mar 11 23:00:53 UTC 2010


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 at redhat.com>
---
 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




More information about the libvir-list mailing list