Loading libprocessgroup/processgroup.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -203,9 +203,8 @@ static void removeUidProcessGroups(const char *uid_path) { 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) { Loading @@ -231,9 +230,8 @@ void removeAllProcessGroups() 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) { Loading libutils/ProcessCallStack.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -131,9 +131,6 @@ void ProcessCallStack::clear() { } void ProcessCallStack::update() { struct dirent *ep; struct dirent entry; std::unique_ptr<DIR, decltype(&closedir)> dp(opendir(PATH_SELF_TASK), closedir); if (dp == NULL) { ALOGE("%s: Failed to update the process's call stacks: %s", Loading @@ -158,8 +155,8 @@ void ProcessCallStack::update() { * Each tid is a directory inside of /proc/self/task * - Read every file in directory => get every tid */ int code; while ((code = readdir_r(dp.get(), &entry, &ep)) == 0 && ep != NULL) { dirent* ep; while ((ep = readdir(dp.get())) != NULL) { pid_t tid = -1; sscanf(ep->d_name, "%d", &tid); Loading Loading @@ -194,10 +191,6 @@ void ProcessCallStack::update() { ALOGV("%s: Got call stack for tid %d (size %zu)", __FUNCTION__, tid, threadInfo.callStack.size()); } if (code != 0) { // returns positive error value on error ALOGE("%s: Failed to readdir from %s: %s", __FUNCTION__, PATH_SELF_TASK, strerror(code)); } } void ProcessCallStack::log(const char* logtag, android_LogPriority priority, Loading Loading
libprocessgroup/processgroup.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -203,9 +203,8 @@ static void removeUidProcessGroups(const char *uid_path) { 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) { Loading @@ -231,9 +230,8 @@ void removeAllProcessGroups() 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) { Loading
libutils/ProcessCallStack.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -131,9 +131,6 @@ void ProcessCallStack::clear() { } void ProcessCallStack::update() { struct dirent *ep; struct dirent entry; std::unique_ptr<DIR, decltype(&closedir)> dp(opendir(PATH_SELF_TASK), closedir); if (dp == NULL) { ALOGE("%s: Failed to update the process's call stacks: %s", Loading @@ -158,8 +155,8 @@ void ProcessCallStack::update() { * Each tid is a directory inside of /proc/self/task * - Read every file in directory => get every tid */ int code; while ((code = readdir_r(dp.get(), &entry, &ep)) == 0 && ep != NULL) { dirent* ep; while ((ep = readdir(dp.get())) != NULL) { pid_t tid = -1; sscanf(ep->d_name, "%d", &tid); Loading Loading @@ -194,10 +191,6 @@ void ProcessCallStack::update() { ALOGV("%s: Got call stack for tid %d (size %zu)", __FUNCTION__, tid, threadInfo.callStack.size()); } if (code != 0) { // returns positive error value on error ALOGE("%s: Failed to readdir from %s: %s", __FUNCTION__, PATH_SELF_TASK, strerror(code)); } } void ProcessCallStack::log(const char* logtag, android_LogPriority priority, Loading