提交 33a5f8ca 编写于 作者: M Matthias Bolte

virsh: Report an error when virGetUserDirectory fails

Otherwise virsh shows the interactive greeting and then silently exists
instead of entering interactive mode.
上级 1d8bcb45
......@@ -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"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册