diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2014-09-04 19:59:27 +0200 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2014-09-04 20:05:35 +0200 |
commit | 241a3ce4c5ff883c160754e0aebd1e1b0894d332 (patch) | |
tree | e39901d3a8b91ad599ec71754dfeba7cdea8dcc1 /mtp/MtpServer.cpp | |
parent | MTP Fix rename in Windows (diff) | |
download | android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar.gz android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar.bz2 android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar.lz android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar.xz android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.tar.zst android_bootable_recovery-241a3ce4c5ff883c160754e0aebd1e1b0894d332.zip |
Diffstat (limited to 'mtp/MtpServer.cpp')
-rwxr-xr-x | mtp/MtpServer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mtp/MtpServer.cpp b/mtp/MtpServer.cpp index 5dec5801e..c044cad7f 100755 --- a/mtp/MtpServer.cpp +++ b/mtp/MtpServer.cpp @@ -1132,7 +1132,12 @@ static void deleteRecursive(const char* path) { strcpy(fileSpot, name); int type = entry->d_type; - if (entry->d_type == DT_DIR) { + struct stat st; + if (lstat(pathbuf, &st)) { + MTPE("Failed to lstat '%s'\n", pathbuf); + continue; + } + if (st.st_mode & S_IFDIR) { deleteRecursive(pathbuf); rmdir(pathbuf); } else { |