mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-13 08:56:09 -06:00
Fix virsh command 'cd'
* 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.
This commit is contained in:
parent
7fbc2e37b8
commit
be2a53e6e0
@ -7465,7 +7465,7 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
if (!ctl->imode) {
|
if (!ctl->imode) {
|
||||||
vshError(ctl, "%s", _("cd: command valid only in interactive mode"));
|
vshError(ctl, "%s", _("cd: command valid only in interactive mode"));
|
||||||
return -1;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = vshCommandOptString(cmd, "dir", &found);
|
dir = vshCommandOptString(cmd, "dir", &found);
|
||||||
@ -7478,10 +7478,10 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
if (chdir (dir) == -1) {
|
if (chdir (dir) == -1) {
|
||||||
vshError(ctl, _("cd: %s: %s"), strerror(errno), dir);
|
vshError(ctl, _("cd: %s: %s"), strerror(errno), dir);
|
||||||
return -1;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user