From 91f5972fa13165a607162ad0789319abbc5384ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Sun, 29 Mar 2009 01:20:02 +0100 Subject: [PATCH] Use CreateDirectory() instead of complicating things. This is Windows sysdeps after all, and _dbus_mkdir() wasn't used anywhere else. (cherry picked from commit 0bbe3787ce1e9e992f2bcbbdfcab1dcdb0b41f24) --- dbus/dbus-sysdeps-win.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 34af24a..126ffee 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -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, -- 2.7.4