am 0b12f0a7: Merge "processgroup: close directories opened by removeAllProcessGroups()" into lmp-dev
* commit '0b12f0a7d6be18705d1972ef9a047159bb001e8f':
processgroup: close directories opened by removeAllProcessGroups()
diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp
index c32e741..f7bc2cd 100644
--- a/libprocessgroup/processgroup.cpp
+++ b/libprocessgroup/processgroup.cpp
@@ -171,6 +171,7 @@
SLOGV("removing %s\n", path);
rmdir(path);
}
+ closedir(uid);
}
}
@@ -180,8 +181,7 @@
DIR *root = opendir(PROCESSGROUP_CGROUP_PATH);
if (root == NULL) {
SLOGE("failed to open %s: %s", PROCESSGROUP_CGROUP_PATH, strerror(errno));
- }
- if (root != NULL) {
+ } else {
struct dirent cur;
struct dirent *dir;
while ((readdir_r(root, &cur, &dir) == 0) && dir) {
@@ -199,6 +199,7 @@
SLOGV("removing %s\n", path);
rmdir(path);
}
+ closedir(root);
}
}