X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcollectd-nagios.c;h=dd90737f6f3a4063685bdd27072d9fb4bd94cd9c;hb=0e38564a0b8ad3655a7261915f3e08cbc53f32a8;hp=b17e47e2e1618949772dd3ccfd3db592ddf643ca;hpb=749b03b3fc459895b7415c7c13753066bf0af55b;p=collectd.git diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index b17e47e2..dd90737f 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -136,14 +136,14 @@ static int filter_ds (size_t *values_num, new_values = (gauge_t *)calloc (match_ds_num_g, sizeof (*new_values)); if (new_values == NULL) { - fprintf (stderr, "malloc failed: %s\n", strerror (errno)); + fprintf (stderr, "calloc failed: %s\n", strerror (errno)); return (RET_UNKNOWN); } new_names = (char **)calloc (match_ds_num_g, sizeof (*new_names)); if (new_names == NULL) { - fprintf (stderr, "malloc failed: %s\n", strerror (errno)); + fprintf (stderr, "calloc failed: %s\n", strerror (errno)); free (new_values); return (RET_UNKNOWN); } @@ -245,6 +245,7 @@ static int match_range (range_t *range, double value) return (((ret - range->invert) == 0) ? 0 : 1); } /* int match_range */ +__attribute__((noreturn)) static void usage (const char *name) { fprintf (stderr, "Usage: %s <-s socket> <-n value_spec> <-H hostname> [options]\n" @@ -617,9 +618,9 @@ static int do_check (lcc_connection_t *connection) status = RET_UNKNOWN; if (consolitation_g == CON_NONE) - status = do_check_con_none (values_num, values, values_names); + status = do_check_con_none (values_num, values, values_names); else if (consolitation_g == CON_AVERAGE) - status = do_check_con_average (values_num, values, values_names); + status = do_check_con_average (values_num, values, values_names); else if (consolitation_g == CON_SUM) status = do_check_con_sum (values_num, values, values_names); else if (consolitation_g == CON_PERCENTAGE) @@ -693,7 +694,7 @@ int main (int argc, char **argv) case 'd': { char **tmp; - tmp = (char **) realloc (match_ds_g, + tmp = realloc (match_ds_g, (match_ds_num_g + 1) * sizeof (char *)); if (tmp == NULL)