An artifact from the time when libcgroup could not handle multiple
cgroup filesystems mounted at multiple points. It is very much possible
a subsystem is not mounted at that point. (FWIW, it is wrong even on a
single mount point, but I am quite surprised that no one hit it yet.)
V1->V2
A minor cleanup possible.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@120
4f4bb910-9a46-0410-90c8-
c897d4f1cd53
if (!strcmp(ent->mnt_type, "cgroup")) {
for (i = 0; controllers[i] != NULL; i++) {
mntopt = hasmntopt(ent, controllers[i]);
+
+ if (!mntopt)
+ continue;
+
mntopt = strtok_r(mntopt, ",", &strtok_buffer);
- if (mntopt &&
- strcmp(mntopt, controllers[i]) == 0) {
+
+ if (strcmp(mntopt, controllers[i]) == 0) {
dbg("matched %s:%s\n", mntopt,
controllers[i]);
strcpy(cg_mount_table[found_mnt].name,