From: Florian Forster Date: Wed, 26 Mar 2008 08:31:33 +0000 (+0100) Subject: utils_cmd_*: Terminate all lines printed to the socket with newline. X-Git-Tag: collectd-4.3.2~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ebbe15f56430838df4397150f6c3089d5851216d;p=collectd.git utils_cmd_*: Terminate all lines printed to the socket with newline. This is a backport of 1ca0b79a4274784e4cc15d45e46e2cfa0c2039cf. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/utils_cmd_putnotif.c b/src/utils_cmd_putnotif.c index 0282e4e2..18c1ecee 100644 --- a/src/utils_cmd_putnotif.c +++ b/src/utils_cmd_putnotif.c @@ -133,7 +133,7 @@ int handle_putnotif (FILE *fh, char **fields, int fields_num) status = parse_option (&n, fields[i]); if (status != 0) { - fprintf (fh, "-1 Error parsing option `%s'", fields[i]); + fprintf (fh, "-1 Error parsing option `%s'\n", fields[i]); break; } } diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c index 7cf0b6da..ec0c09ae 100644 --- a/src/utils_cmd_putval.c +++ b/src/utils_cmd_putval.c @@ -36,7 +36,7 @@ static int parse_value (const data_set_t *ds, value_list_t *vl, char *value_str = strchr (time_str, ':'); if (value_str == NULL) { - fprintf (fh, "-1 No time found."); + fprintf (fh, "-1 No time found.\n"); return (-1); } *value_str = '\0'; value_str++; @@ -153,7 +153,7 @@ int handle_putval (FILE *fh, char **fields, int fields_num) || ((type_instance != NULL) && (strlen (type_instance) >= sizeof (vl.type_instance)))) { - fprintf (fh, "-1 Identifier too long."); + fprintf (fh, "-1 Identifier too long.\n"); return (-1); } @@ -172,7 +172,7 @@ int handle_putval (FILE *fh, char **fields, int fields_num) vl.values = (value_t *) malloc (vl.values_len * sizeof (value_t)); if (vl.values == NULL) { - fprintf (fh, "-1 malloc failed."); + fprintf (fh, "-1 malloc failed.\n"); return (-1); } @@ -191,7 +191,7 @@ int handle_putval (FILE *fh, char **fields, int fields_num) { if (parse_option (&vl, fields[i]) != 0) { - fprintf (fh, "-1 Error parsing option `%s'", + fprintf (fh, "-1 Error parsing option `%s'\n", fields[i]); break; }