summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2018-10-30 13:12:34 +0800
committerGravatar Nikias Bassen2018-10-30 13:12:34 +0800
commit92c5462adef87b1e577b8557b6b9c64d5a089544 (patch)
treed8da666f83c1090fe738c1f5837d727ed9a4e989 /tools
parentd72b747e590044f9970ef26827f3af3ea9c1eb4a (diff)
downloadlibimobiledevice-92c5462adef87b1e577b8557b6b9c64d5a089544.tar.gz
libimobiledevice-92c5462adef87b1e577b8557b6b9c64d5a089544.tar.bz2
idevicebackup2: Fix scan_directory() for platforms not having d_type in struct dirent
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebackup2.c6
1 files changed, 6 insertions, 0 deletions
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;