int threadnum = 1;
int crash_tid = -1;
DIR *dir;
- struct dirent entry;
- struct dirent *dentry = NULL;
+ struct dirent *entry;
char task_path[PATH_MAX];
struct stat sb;
fprintf(errfile, "[crash-stack] cannot open %s\n", task_path);
return -1;
} else {
- while (readdir_r(dir, &entry, &dentry) == 0 && dentry) {
- if (strcmp(dentry->d_name, ".") == 0 ||
- strcmp(dentry->d_name, "..") == 0)
+ while ((entry = readdir(dir)) != NULL) {
+ if (strcmp(entry->d_name, ".") == 0 ||
+ strcmp(entry->d_name, "..") == 0)
continue;
crash_tid = check_thread_wchan(pid,
- atoi(dentry->d_name));
+ atoi(entry->d_name));
if (crash_tid > 0)
break;
}