From 33a5f8ca82adcc9311986988a61bd6b35de8ff20 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Sun, 15 May 2011 07:31:42 +0200 Subject: [PATCH] virsh: Report an error when virGetUserDirectory fails Otherwise virsh shows the interactive greeting and then silently exists instead of entering interactive mode. --- tools/virsh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/virsh.c b/tools/virsh.c index e35637d0f6..a38750ffc8 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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")); -- 2.47.2