Use readdir instead of readdir_r.
http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html
Test: boots.
Change-Id: If75532e24fe4d17743bf8e8c9590156dee378a63
diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp
index 65bbc1e..7c15429 100644
--- a/libprocessgroup/processgroup.cpp
+++ b/libprocessgroup/processgroup.cpp
@@ -203,9 +203,8 @@
{
std::unique_ptr<DIR, decltype(&closedir)> uid(opendir(uid_path), closedir);
if (uid != NULL) {
- struct dirent cur;
- struct dirent *dir;
- while ((readdir_r(uid.get(), &cur, &dir) == 0) && dir) {
+ dirent* dir;
+ while ((dir = readdir(uid.get())) != nullptr) {
char path[PROCESSGROUP_MAX_PATH_LEN];
if (dir->d_type != DT_DIR) {
@@ -231,9 +230,8 @@
if (root == NULL) {
PLOG(ERROR) << "failed to open " << cgroup_root_path;
} else {
- struct dirent cur;
- struct dirent *dir;
- while ((readdir_r(root.get(), &cur, &dir) == 0) && dir) {
+ dirent* dir;
+ while ((dir = readdir(root.get())) != nullptr) {
char path[PROCESSGROUP_MAX_PATH_LEN];
if (dir->d_type != DT_DIR) {