]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Kill double slash from kvm__get_dir()
authorPekka Enberg <penberg@kernel.org>
Tue, 25 Oct 2011 12:09:02 +0000 (15:09 +0300)
committerPekka Enberg <penberg@kernel.org>
Tue, 25 Oct 2011 13:21:39 +0000 (16:21 +0300)
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 <gorcunov@gmail.com>
Acked-by: Sasha Levin <levinsasha928@gmail.com>
Cc: Asias He <asias.hejun@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/kvm.c

index 8d6b5e1f040260092813cf1c2eccac88b1c0116d..6f1f107c69b59d5857f1f92cc2c4266137a32268 100644 (file)
@@ -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, ...)