From 7f66841f8a5f1ebe4360293783f97efd680ecb1f Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 6 Apr 2011 08:36:58 +0200 Subject: [PATCH] Fixed parsing of mount options hasmntopt() returns start of the matching string, i.e. when looking for 'cpuacct' option it can return 'cpuacct,cpuset' if these two are mounted together. So, don't use result of this function, use internal table of controllers instead when checking for duplicates. Signed-off-by: Jan Safranek Acked-by: Ivana Hutarova Varekova --- src/api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api.c b/src/api.c index b76b7932..c3dba988 100644 --- a/src/api.c +++ b/src/api.c @@ -817,7 +817,8 @@ int cgroup_init(void) /* do not have duplicates in mount table */ duplicate = 0; for (j = 0; j < found_mnt; j++) { - if (strncmp(mntopt, cg_mount_table[j].name, + if (strncmp(controllers[i], + cg_mount_table[j].name, FILENAME_MAX) == 0) { duplicate = 1; break; -- 2.47.2