From: Sebastian Harl Date: Tue, 25 Mar 2008 14:56:59 +0000 (+0100) Subject: utils_cmd_*: Terminate all lines printed to the socket with newline. X-Git-Tag: collectd-4.4.0~72 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1ca0b79a4274784e4cc15d45e46e2cfa0c2039cf;p=collectd.git utils_cmd_*: Terminate all lines printed to the socket with newline. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/utils_cmd_getval.c b/src/utils_cmd_getval.c index fa5cdf2c..85028d0f 100644 --- a/src/utils_cmd_getval.c +++ b/src/utils_cmd_getval.c @@ -52,7 +52,7 @@ int handle_getval (FILE *fh, char **fields, int fields_num) if (strlen (fields[1]) < strlen ("h/p/t")) { - fprintf (fh, "-1 Invalied identifier, %s", fields[1]); + fprintf (fh, "-1 Invalied identifier, %s\n", fields[1]); fflush (fh); return (-1); } @@ -82,7 +82,7 @@ int handle_getval (FILE *fh, char **fields, int fields_num) status = uc_get_rate_by_name (fields[1], &values, &values_num); if (status != 0) { - fprintf (fh, "-1 No such value"); + fprintf (fh, "-1 No such value\n"); fflush (fh); return (-1); } 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; }