Code

processes: use cf_util_get_boolean for get "CollectContextSwitch"
authorManuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
Sun, 31 May 2015 18:56:49 +0000 (20:56 +0200)
committerManuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
Sun, 31 May 2015 18:56:49 +0000 (20:56 +0200)
src/processes.c

index d549291e063e12d18e7226143651fee91371cce7..059f9eba812613e48411d619e561de76dded81f0 100644 (file)
@@ -609,14 +609,7 @@ static int ps_config (oconfig_item_t *ci)
                }
                else if (strcasecmp (c->key, "CollectContextSwitch") == 0)
                {
-                       if ((c->values_num != 1) 
-                                       || (c->values[0].type != OCONFIG_TYPE_BOOLEAN))
-                       {
-                               ERROR ("processes plugin: `CollectContextSwitch' needs exactly "
-                                               "one boolean argument.");
-                               continue;
-                       }
-                       report_ctx_switch = c->values[0].value.boolean ? 1 : 0;
+                       cf_util_get_boolean (c, &report_ctx_switch);
                }
                else
                {