Skip to content
Browse files

am a6fb0e0: Merge "Fix debuggerd\'s use of readdir_r(3)."

* commit 'a6fb0e05aa95995445c6f2b65f07db26bdbfd46c':
  Fix debuggerd's use of readdir_r(3).
  • Loading branch information...
2 parents 6575a16 + a6fb0e0 commit 3427e80ef38bc7aae1278cfe78a65d9524f92c69 @enh enh committed with Android Git Automerger Oct 30, 2012
Showing with 5 additions and 7 deletions.
  1. +3 −4 debuggerd/backtrace.c
  2. +2 −3 debuggerd/tombstone.c
View
7 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;
}
View
5 debuggerd/tombstone.c
@@ -414,9 +414,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;

0 comments on commit 3427e80

Please sign in to comment.
Something went wrong with that request. Please try again.