mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
virsh: Report an error when virGetUserDirectory fails
Otherwise virsh shows the interactive greeting and then silently exists instead of entering interactive mode.
This commit is contained in:
parent
1d8bcb45ca
commit
33a5f8ca82
@ -12624,8 +12624,10 @@ vshReadlineInit(vshControl *ctl)
|
||||
/* Prepare to read/write history from/to the ~/.virsh/history file */
|
||||
userdir = virGetUserDirectory(getuid());
|
||||
|
||||
if (userdir == NULL)
|
||||
if (userdir == NULL) {
|
||||
vshError(ctl, "%s", _("Could not determine home directory"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virAsprintf(&ctl->historydir, "%s/.virsh", userdir) < 0) {
|
||||
vshError(ctl, "%s", _("Out of memory"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user