]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix virsh command 'cd'
authorChris Lalancette <clalance@redhat.com>
Fri, 12 Mar 2010 10:49:16 +0000 (11:49 +0100)
committerDaniel Veillard <veillard@redhat.com>
Fri, 12 Mar 2010 10:49:16 +0000 (11:49 +0100)
* tools/virsh.c: 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.

tools/virsh.c

index 33f36474f620cdd77e4e6cdb5d7733b34ca5e1c7..952114470e92604c7df541e85a94155b91f8256e 100644 (file)
@@ -7465,7 +7465,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);
@@ -7478,10 +7478,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