Skip to contentSkip to conversation

kvm tools: Kill double slash from kvm__get_dir()

PATCH New Pekka Enberg 1 participant 1 message Oct 25, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

Cc Asias He <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Sasha Levin <[email protected]>
---
 tools/kvm/kvm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
tools/kvm/kvm.c +5 -1
index 8d6b5e1..8605fc8 100644
@@ -86,7 +86,11 @@ 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);
+
+	realpath(tmp, kvm_dir);
 }
 
 void kvm__set_dir(const char *fmt, ...)
Signature · 1 line
1.7.6.4