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 d549291..059f9eb 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
                {