Use CreateDirectory() instead of complicating things.
authorOle André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
Sun, 29 Mar 2009 00:20:02 +0000 (01:20 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 30 Nov 2009 11:00:20 +0000 (12:00 +0100)
This is Windows sysdeps after all, and _dbus_mkdir() wasn't used anywhere else.
(cherry picked from commit 0bbe3787ce1e9e992f2bcbbdfcab1dcdb0b41f24)

dbus/dbus-sysdeps-win.c

index 34af24a..126ffee 100644 (file)
@@ -1433,17 +1433,6 @@ Original CVS version of dbus-sysdeps.c
 
 
 /**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-int _dbus_mkdir (const char *path,
-                 mode_t mode)
-{
-  return _mkdir(path);
-}
-
-/**
  * Exit the process, returning the given value.
  *
  * @param code the exit code
@@ -2417,9 +2406,9 @@ _dbus_create_directory (const DBusString *filename,
 
   filename_c = _dbus_string_get_const_data (filename);
 
-  if (_dbus_mkdir (filename_c, 0700) < 0)
+  if (!CreateDirectory (filename_c, NULL))
     {
-      if (errno == EEXIST)
+      if (GetLastError () == ERROR_ALREADY_EXISTS)
         return TRUE;
 
       dbus_set_error (error, DBUS_ERROR_FAILED,