summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: afac1b5)
raw | patch | inline | side by side (parent: afac1b5)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 May 2008 15:21:42 +0000 (17:21 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 May 2008 15:21:42 +0000 (17:21 +0200) |
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 67471341f8f6bd396ba9ecd4cd45e7639a3f5b10..79451d320d3b500fd321edfd9fed226565d74c7a 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
/* put all pre-defined 'Process' names from config to list_head_g tree */
static int ps_config (const char *key, const char *value)
{
- char *new_val;
- char *fields[2];
- int fields_num;
-
if (strcasecmp (key, "Process") == 0)
{
ps_list_register (value, NULL);
- return (0);
}
-
- if (strcasecmp (key, "ProcessMatch") == 0)
+ else if (strcasecmp (key, "ProcessMatch") == 0)
{
+ char *new_val;
+ char *fields[3];
+ int fields_num;
+
new_val = strdup (value);
if (new_val == NULL)
- return (-1);
- fields_num = strsplit (new_val, fields, 2);
+ return (1);
+ fields_num = strsplit (new_val, fields,
+ STATIC_ARRAY_SIZE (fields));
if (fields_num != 2)
{
sfree (new_val);
- return (-1);
+ return (1);
}
ps_list_register (fields[0], fields[1]);
sfree (new_val);
- return (0);
+ }
+ else
+ {
+ return (-1);
}
- return (-1);
+ return (0);
}
static int ps_init (void)