[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 5/9] daemon error handling: fix case_sensitive_path for Windows.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
>From 6422809e06cf8e7044abe9afa2bfa9aea76b2ba1 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Fri, 27 Nov 2009 13:54:11 +0000
Subject: [PATCH 5/9] daemon error handling: fix case_sensitive_path for Windows.

---
 daemon/realpath.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/daemon/realpath.c b/daemon/realpath.c
index 1a6bc5f..3f67c1b 100644
--- a/daemon/realpath.c
+++ b/daemon/realpath.c
@@ -69,6 +69,7 @@ do_realpath (const char *path)
 char *
 do_case_sensitive_path (const char *path)
 {
+#ifndef WIN32
   char ret[PATH_MAX+1] = "/";
   size_t next = 1;
   int fd_cwd;
@@ -195,4 +196,15 @@ do_case_sensitive_path (const char *path)
  error:
   close (fd_cwd);
   return NULL;
+#else /* WIN32 */
+  /* On Win32 paths are always handled case insensitively, so there is
+   * no need for this function to modify the path in any way.
+   */
+  char *ret = strdup (path);
+  if (ret == NULL) {
+    reply_with_perror ("strdup");
+    return NULL;
+  }
+  return ret;
+#endif /* WIN32 */
 }
-- 
1.6.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]