From: Pekka Enberg Date: Tue, 25 Oct 2011 12:09:02 +0000 (+0300) Subject: kvm tools: Kill double slash from kvm__get_dir() X-Git-Tag: next-20111101~5^2~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7f7560641ef59add1c316fc8130829650edd98ad;p=karo-tx-linux.git kvm tools: Kill double slash from kvm__get_dir() In preparation for showing kvm__get_dir() path to the user, kill the unnecessary double slash to make the output more readable. Acked-by: Cyrill Gorcunov Acked-by: Sasha Levin Cc: Asias He Cc: Ingo Molnar Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 8d6b5e1f0402..6f1f107c69b5 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -86,7 +86,12 @@ static char kvm_dir[PATH_MAX]; static void set_dir(const char *fmt, va_list args) { - vsnprintf(kvm_dir, sizeof(kvm_dir), fmt, args); + char tmp[PATH_MAX]; + + vsnprintf(tmp, sizeof(tmp), fmt, args); + + if (!realpath(tmp, kvm_dir)) + die("Unable to set KVM tool directory"); } void kvm__set_dir(const char *fmt, ...)