1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
From 7aafbaf9983412c70a4e687fcf37ae16864a6b4a Mon Sep 17 00:00:00 2001
From: Marcin Szewczyk <marcin.szewczyk@wodny.org>
Date: Sun, 12 Oct 2014 18:45:58 +0200
Subject: [PATCH 2/2] check "enabled" column when parsing /proc/cgroups
---
fs.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs.c b/fs.c
index 7568ce5..7b10593 100644
--- a/fs.c
+++ b/fs.c
@@ -554,6 +554,15 @@ static bool collect_kernel_subsystems(void)
continue;
*p = '\0';
+ // TODO: How stable is /proc/cgroups interface?
+ // Check the 'enabled' column
+ p = strrchr(p+1, '\t');
+ if (!p)
+ continue;
+
+ if (*(p+1) != '1')
+ continue;
+
if (!save_mount_subsys(line)) {
nih_fatal("Error storing subsystem %s", line);
goto out;
--
2.1.0
|