| Index: runtime/bin/directory_android.cc
|
| diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
|
| index 9a2d1662b914f45d8311071ce91f5230ec775b62..1fb42cb1e700faa67952e8338c4c808fb39173b5 100644
|
| --- a/runtime/bin/directory_android.cc
|
| +++ b/runtime/bin/directory_android.cc
|
| @@ -169,6 +169,9 @@ static bool ListRecursively(PathBuffer* path,
|
| int stat_success;
|
| if (follow_links) {
|
| stat_success = TEMP_FAILURE_RETRY(stat(path->data, &entry_info));
|
| + if (stat_success == -1) {
|
| + stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
|
| + }
|
| } else {
|
| stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
|
| }
|
| @@ -189,7 +192,6 @@ static bool ListRecursively(PathBuffer* path,
|
| path,
|
| listing) && success;
|
| } else if (S_ISLNK(entry_info.st_mode)) {
|
| - ASSERT(!follow_links);
|
| success = HandleLink(entry.d_name,
|
| path,
|
| listing) && success;
|
| @@ -232,7 +234,6 @@ static bool DeleteDir(char* dir_name,
|
|
|
|
|
| static bool DeleteRecursively(PathBuffer* path) {
|
| - if (!path->Add(File::PathSeparator())) return false;
|
| // Do not recurse into links for deletion. Instead delete the link.
|
| struct stat st;
|
| if (TEMP_FAILURE_RETRY(lstat(path->data, &st)) == -1) {
|
| @@ -241,6 +242,8 @@ static bool DeleteRecursively(PathBuffer* path) {
|
| return (remove(path->data) == 0);
|
| }
|
|
|
| + if (!path->Add(File::PathSeparator())) return false;
|
| +
|
| // Not a link. Attempt to open as a directory and recurse into the
|
| // directory.
|
| DIR* dir_pointer;
|
|
|