diff options
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index ec210fc..69ff13b 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -83,6 +83,8 @@ case ${host_os} in | |||
| 83 | esac | 83 | esac |
| 84 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) | 84 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) |
| 85 | 85 | ||
| 86 | AC_CHECK_MEMBER(struct dirent.d_type, AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, [define if struct dirent has member d_type]),, [#include <dirent.h>]) | ||
| 87 | |||
| 86 | # Cython Python Bindings | 88 | # Cython Python Bindings |
| 87 | AC_ARG_WITH([cython], | 89 | AC_ARG_WITH([cython], |
| 88 | [AS_HELP_STRING([--without-cython], | 90 | [AS_HELP_STRING([--without-cython], |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 02611a1..f7ea53a 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -254,7 +254,13 @@ static void scan_directory(const char *path, struct entry **files, struct entry | |||
| 254 | } | 254 | } |
| 255 | char *fpath = string_build_path(path, ep->d_name, NULL); | 255 | char *fpath = string_build_path(path, ep->d_name, NULL); |
| 256 | if (fpath) { | 256 | if (fpath) { |
| 257 | #ifdef HAVE_DIRENT_D_TYPE | ||
| 257 | if (ep->d_type & DT_DIR) { | 258 | if (ep->d_type & DT_DIR) { |
| 259 | #else | ||
| 260 | struct stat st; | ||
| 261 | if (stat(fpath, &st) != 0) return; | ||
| 262 | if (S_ISDIR(st.st_mode)) { | ||
| 263 | #endif | ||
| 258 | struct entry *ent = malloc(sizeof(struct entry)); | 264 | struct entry *ent = malloc(sizeof(struct entry)); |
| 259 | if (!ent) return; | 265 | if (!ent) return; |
| 260 | ent->name = fpath; | 266 | ent->name = fpath; |
