diff options
| author | 2024-05-18 23:47:51 +0200 | |
|---|---|---|
| committer | 2024-05-18 23:47:51 +0200 | |
| commit | 80e13a37328521d9f696e60662c300b80e7b4106 (patch) | |
| tree | cb9e7f7e47844a17260435ab1c1f4d8a796df4be /tools | |
| parent | 753844b9de14c4388c168b1e30191c45a1c6c443 (diff) | |
| download | libimobiledevice-80e13a37328521d9f696e60662c300b80e7b4106.tar.gz libimobiledevice-80e13a37328521d9f696e60662c300b80e7b4106.tar.bz2 | |
tools/afcclient: Fix build for Windows
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/afcclient.c | 11 |
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 | |||
| 771 | return succeed; | 771 | return succeed; |
| 772 | } | 772 | } |
| 773 | 773 | ||
| 774 | static int __mkdir(const char* path) | ||
| 775 | { | ||
| 776 | #ifdef WIN32 | ||
| 777 | return mkdir(path); | ||
| 778 | #else | ||
| 779 | return mkdir(path, 0755); | ||
| 780 | #endif | ||
| 781 | } | ||
| 782 | |||
| 774 | static uint8_t get_file(afc_client_t afc, const char *srcpath, const char *dstpath, uint8_t force_overwrite, uint8_t recursive_get) | 783 | static uint8_t get_file(afc_client_t afc, const char *srcpath, const char *dstpath, uint8_t force_overwrite, uint8_t recursive_get) |
| 775 | { | 784 | { |
| 776 | char **info = NULL; | 785 | char **info = NULL; |
| @@ -817,7 +826,7 @@ static uint8_t get_file(afc_client_t afc, const char *srcpath, const char *dstpa | |||
| 817 | printf("Error: Failed to write into existing directory without '-f': %s\n", dstpath); | 826 | printf("Error: Failed to write into existing directory without '-f': %s\n", dstpath); |
| 818 | return 0; | 827 | return 0; |
| 819 | } | 828 | } |
| 820 | } else if (mkdir(dstpath, 0777) != 0) { | 829 | } else if (__mkdir(dstpath) != 0) { |
| 821 | printf("Error: Failed to create directory '%s': %s\n", dstpath, strerror(errno)); | 830 | printf("Error: Failed to create directory '%s': %s\n", dstpath, strerror(errno)); |
| 822 | afc_dictionary_free(entries); | 831 | afc_dictionary_free(entries); |
| 823 | return 0; | 832 | return 0; |
