summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-06-04 13:30:45 -0700
committerChristopher Ferris <cferris@google.com>2015-06-04 13:30:45 -0700
commit5edb0f40f654c804d38f1bff43f91719e189c892 (patch)
tree7604facbaaa4cade64dc560b84e52da3aec52485 /libc/bionic
parent0c29aabad25832ec249288c8da3cf080c898ba74 (diff)
downloadbionic-5edb0f40f654c804d38f1bff43f91719e189c892.zip
bionic-5edb0f40f654c804d38f1bff43f91719e189c892.tar.gz
bionic-5edb0f40f654c804d38f1bff43f91719e189c892.tar.bz2
Reorder DIR structure due to bad apps.
It turns out that apportable apps expect that the DIR structure is the same as in L and below. Modify the structure to have the same order, and move the new variable to the end of the structure. Bug: 21037208 Change-Id: Id1258e9dc19423109a2c3a8086d3022965591166
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/dirent.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libc/bionic/dirent.cpp b/libc/bionic/dirent.cpp
index fb45398..6fd3842 100644
--- a/libc/bionic/dirent.cpp
+++ b/libc/bionic/dirent.cpp
@@ -41,13 +41,19 @@
extern "C" int __getdents64(unsigned int, dirent*, unsigned int);
+// Apportable decided to copy the data structure from this file
+// and use it in their own code, but they also call into readdir.
+// In order to avoid a lockup, the structure must be maintained in
+// the exact same order as in L and below. New structure members
+// need to be added to the end of this structure.
+// See b/21037208 for more details.
struct DIR {
int fd_;
size_t available_bytes_;
dirent* next_;
- long current_pos_;
pthread_mutex_t mutex_;
dirent buff_[15];
+ long current_pos_;
};
static DIR* __allocate_DIR(int fd) {