summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-05-18 23:47:51 +0200
committerGravatar Nikias Bassen2024-05-18 23:47:51 +0200
commit80e13a37328521d9f696e60662c300b80e7b4106 (patch)
treecb9e7f7e47844a17260435ab1c1f4d8a796df4be /tools
parent753844b9de14c4388c168b1e30191c45a1c6c443 (diff)
downloadlibimobiledevice-80e13a37328521d9f696e60662c300b80e7b4106.tar.gz
libimobiledevice-80e13a37328521d9f696e60662c300b80e7b4106.tar.bz2
tools/afcclient: Fix build for Windows
Diffstat (limited to 'tools')
-rw-r--r--tools/afcclient.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/afcclient.c b/tools/afcclient.c
index 25b0383..71a1c32 100644
--- a/tools/afcclient.c
+++ b/tools/afcclient.c
@@ -771,6 +771,15 @@ static uint8_t get_single_file(afc_client_t afc, const char *srcpath, const char
return succeed;
}
+static int __mkdir(const char* path)
+{
+#ifdef WIN32
+ return mkdir(path);
+#else
+ return mkdir(path, 0755);
+#endif
+}
+
static uint8_t get_file(afc_client_t afc, const char *srcpath, const char *dstpath, uint8_t force_overwrite, uint8_t recursive_get)
{
char **info = NULL;
@@ -817,7 +826,7 @@ static uint8_t get_file(afc_client_t afc, const char *srcpath, const char *dstpa
printf("Error: Failed to write into existing directory without '-f': %s\n", dstpath);
return 0;
}
- } else if (mkdir(dstpath, 0777) != 0) {
+ } else if (__mkdir(dstpath) != 0) {
printf("Error: Failed to create directory '%s': %s\n", dstpath, strerror(errno));
afc_dictionary_free(entries);
return 0;