summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-09-10 19:33:58 +0200
committerGravatar Martin Szulecki2012-03-19 01:39:00 +0100
commitd619762b8eb9e0ef180018e8731744a5c9a8a6bd (patch)
tree94dde4ce24bc66c854a15baeebbc38ab7f00e2e3
parent475c9679716eec92e3508063b7486e3508c4c974 (diff)
downloadlibimobiledevice-d619762b8eb9e0ef180018e8731744a5c9a8a6bd.tar.gz
libimobiledevice-d619762b8eb9e0ef180018e8731744a5c9a8a6bd.tar.bz2
WIN32: mkdir takes only one argument
-rw-r--r--src/userpref.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/userpref.c b/src/userpref.c
index d44d5aa..f4e9fe6 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -133,10 +133,19 @@ static const char *userpref_get_config_dir()
return __config_dir;
}
+static int __mkdir(const char *dir, int mode)
+{
+#ifdef WIN32
+ return mkdir(dir);
+#else
+ return mkdir(dir, mode);
+#endif
+}
+
static int mkdir_with_parents(const char *dir, int mode)
{
if (!dir) return -1;
- if (mkdir(dir, mode) == 0) {
+ if (__mkdir(dir, mode) == 0) {
return 0;
} else {
if (errno == EEXIST) return 0;