diff options
| author | 2016-09-18 16:24:14 +0200 | |
|---|---|---|
| committer | 2016-09-18 16:24:14 +0200 | |
| commit | 98a096134b23be980a0aa56e775c5510f0e93595 (patch) | |
| tree | 124ee9406bcf157e8307fadea04ac73da195572a | |
| parent | 6aecc7228dbb30b4db48374ffb4ae4a1616bdd95 (diff) | |
| download | libimobiledevice-98a096134b23be980a0aa56e775c5510f0e93595.tar.gz libimobiledevice-98a096134b23be980a0aa56e775c5510f0e93595.tar.bz2 | |
idevicebackup2: Fix build on win32 after last commit
| -rw-r--r-- | tools/idevicebackup2.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index c822d7f..3b2c0af 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -192,6 +192,20 @@ static int mkdir_with_parents(const char *dir, int mode) | |||
| 192 | return res; | 192 | return res; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | #ifdef WIN32 | ||
| 196 | static int win32err_to_errno(int err_value) | ||
| 197 | { | ||
| 198 | switch (err_value) { | ||
| 199 | case ERROR_FILE_NOT_FOUND: | ||
| 200 | return ENOENT; | ||
| 201 | case ERROR_ALREADY_EXISTS: | ||
| 202 | return EEXIST; | ||
| 203 | default: | ||
| 204 | return EFAULT; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | #endif | ||
| 208 | |||
| 195 | static int remove_file(const char* path) | 209 | static int remove_file(const char* path) |
| 196 | { | 210 | { |
| 197 | int e = 0; | 211 | int e = 0; |
| @@ -518,20 +532,6 @@ static int errno_to_device_error(int errno_value) | |||
| 518 | } | 532 | } |
| 519 | } | 533 | } |
| 520 | 534 | ||
| 521 | #ifdef WIN32 | ||
| 522 | static int win32err_to_errno(int err_value) | ||
| 523 | { | ||
| 524 | switch (err_value) { | ||
| 525 | case ERROR_FILE_NOT_FOUND: | ||
| 526 | return ENOENT; | ||
| 527 | case ERROR_ALREADY_EXISTS: | ||
| 528 | return EEXIST; | ||
| 529 | default: | ||
| 530 | return EFAULT; | ||
| 531 | } | ||
| 532 | } | ||
| 533 | #endif | ||
| 534 | |||
| 535 | static int mb2_handle_send_file(mobilebackup2_client_t mobilebackup2, const char *backup_dir, const char *path, plist_t *errplist) | 535 | static int mb2_handle_send_file(mobilebackup2_client_t mobilebackup2, const char *backup_dir, const char *path, plist_t *errplist) |
| 536 | { | 536 | { |
| 537 | uint32_t nlen = 0; | 537 | uint32_t nlen = 0; |
