author | Florian Forster <octo@collectd.org> | |
Wed, 28 Aug 2013 13:22:37 +0000 (15:22 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 28 Aug 2013 13:22:37 +0000 (15:22 +0200) |
src/cgroups.c | patch | blob | history |
diff --git a/src/cgroups.c b/src/cgroups.c
index a515cf5b0c62511d97cf39a18fcd864c0cee621d..17b12d0435150189bba3fe15ab9a6fd66d57be76 100644 (file)
--- a/src/cgroups.c
+++ b/src/cgroups.c
if (fh == NULL)
{
char errbuf[1024];
- ERROR ("cgroups pluign: fopen (\"%s\") failed: %s",
+ ERROR ("cgroups plugin: fopen (\"%s\") failed: %s",
abs_path,
sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
*
* user: 12345
* system: 23456
+ *
+ * Or:
+ *
+ * user 12345
+ * system 23456
*/
strstripnewline (buf);
numfields = strsplit (buf, fields, STATIC_ARRAY_SIZE (fields));
if (key_len < 2)
continue;
- /* Strip colon off the first column */
- if (key[key_len - 1] != ':')
- continue;
- key[key_len - 1] = 0;
+ /* Strip colon off the first column, if found */
+ if (key[key_len - 1] == ':')
+ key[key_len - 1] = 0;
status = parse_value (fields[1], &value, DS_TYPE_DERIVE);
if (status != 0)