diff options
| author | 2011-09-10 19:33:58 +0200 | |
|---|---|---|
| committer | 2012-03-19 01:39:00 +0100 | |
| commit | d619762b8eb9e0ef180018e8731744a5c9a8a6bd (patch) | |
| tree | 94dde4ce24bc66c854a15baeebbc38ab7f00e2e3 /src | |
| parent | 475c9679716eec92e3508063b7486e3508c4c974 (diff) | |
| download | libimobiledevice-d619762b8eb9e0ef180018e8731744a5c9a8a6bd.tar.gz libimobiledevice-d619762b8eb9e0ef180018e8731744a5c9a8a6bd.tar.bz2 | |
WIN32: mkdir takes only one argument
Diffstat (limited to 'src')
| -rw-r--r-- | src/userpref.c | 11 |
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() | |||
| 133 | return __config_dir; | 133 | return __config_dir; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | static int __mkdir(const char *dir, int mode) | ||
| 137 | { | ||
| 138 | #ifdef WIN32 | ||
| 139 | return mkdir(dir); | ||
| 140 | #else | ||
| 141 | return mkdir(dir, mode); | ||
| 142 | #endif | ||
| 143 | } | ||
| 144 | |||
| 136 | static int mkdir_with_parents(const char *dir, int mode) | 145 | static int mkdir_with_parents(const char *dir, int mode) |
| 137 | { | 146 | { |
| 138 | if (!dir) return -1; | 147 | if (!dir) return -1; |
| 139 | if (mkdir(dir, mode) == 0) { | 148 | if (__mkdir(dir, mode) == 0) { |
| 140 | return 0; | 149 | return 0; |
| 141 | } else { | 150 | } else { |
| 142 | if (errno == EEXIST) return 0; | 151 | if (errno == EEXIST) return 0; |
