summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2bc090)
raw | patch | inline | side by side (parent: f2bc090)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 25 May 2007 17:48:56 +0000 (19:48 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 25 May 2007 17:48:56 +0000 (19:48 +0200) |
Also the debug messages have been beautified.
src/exec.c | patch | blob | history |
diff --git a/src/exec.c b/src/exec.c
index 518efc870739169381d1ab51848bc3ec23de42f2..bd96e07b0d2b700efc92ed6b90b77b04ff576a81 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
char *type_instance;
char *value;
- DEBUG ("buffer = %s", buffer);
-
len = strlen (buffer);
+
+ /* Remove newline from end. */
+ while ((len > 0) && ((buffer[len - 1] == '\n')
+ || (buffer[len - 1] == '\r')))
+ buffer[--len] = '\0';
+
+ DEBUG ("exec plugin: exec_read_one: buffer = %s", buffer);
+
if (len < 5)
continue;
value = strchr (type_instance, ',');
if (value == NULL)
+ {
+ WARNING ("exec plugin: type-instance is missing.");
continue;
+ }
*value = '\0';
value++;
- DEBUG ("value = %s", value);
+ DEBUG ("exec plugin: exec_read_one: type = %s; type_instance = %s; "
+ "value = %s;", type, type_instance, value);
if (strcasecmp ("counter", type) == 0)
submit_counter (type_instance, atoll (value));