summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-10-26 16:47:09 -0700
committerElliott Hughes <enh@google.com>2012-10-26 16:47:09 -0700
commitc463d2cf9c5717dcd37589deb01615b984266c8c (patch)
tree9af97253fd18d3c61d8b0d74da8705ff61fe7b60 /debuggerd
parent8f98c4b5f011db8637ce1b9361e82d59b13434f4 (diff)
downloadsystem_core-c463d2cf9c5717dcd37589deb01615b984266c8c.zip
system_core-c463d2cf9c5717dcd37589deb01615b984266c8c.tar.gz
system_core-c463d2cf9c5717dcd37589deb01615b984266c8c.tar.bz2
Fix debuggerd's use of readdir_r(3).
Change-Id: I1b178af054cefebfb774320e4b4699d6dc8bbb01
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/backtrace.c7
-rw-r--r--debuggerd/tombstone.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/debuggerd/backtrace.c b/debuggerd/backtrace.c
index 62f7f32..ba76e7d 100644
--- a/debuggerd/backtrace.c
+++ b/debuggerd/backtrace.c
@@ -125,10 +125,9 @@ void dump_backtrace(int fd, pid_t pid, pid_t tid, bool* detach_failed,
char task_path[64];
snprintf(task_path, sizeof(task_path), "/proc/%d/task", pid);
DIR* d = opendir(task_path);
- if (d) {
- struct dirent debuf;
- struct dirent *de;
- while (!readdir_r(d, &debuf, &de) && de) {
+ if (d != NULL) {
+ struct dirent* de = NULL;
+ while ((de = readdir(d)) != NULL) {
if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) {
continue;
}
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 52223da..47a1bf5 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -405,9 +405,8 @@ static bool dump_sibling_thread_report(const ptrace_context_t* context,
}
bool detach_failed = false;
- struct dirent debuf;
- struct dirent *de;
- while (!readdir_r(d, &debuf, &de) && de) {
+ struct dirent* de;
+ while ((de = readdir(d)) != NULL) {
/* Ignore "." and ".." */
if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) {
continue;