From 9b1ae7f672fd2712b452a58e0682cdea2e34c0f8 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 5 Mar 2016 16:25:38 +0100 Subject: [PATCH] Mark functions that exit as noreturn --- src/collectd-nagios.c | 1 + src/collectdmon.c | 3 ++- src/daemon/collectd.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index b17e47e2..49e84f35 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -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" diff --git a/src/collectdmon.c b/src/collectdmon.c index 65271ddd..a5ed065d 100644 --- a/src/collectdmon.c +++ b/src/collectdmon.c @@ -69,7 +69,8 @@ static int restart = 0; static char *pidfile = NULL; static pid_t collectd_pid = 0; -static void exit_usage (char *name) +__attribute__((noreturn)) +static void exit_usage (const char *name) { printf ("Usage: %s [-- ]\n" diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index a970d03e..6f299174 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -269,6 +269,7 @@ static void update_kstat (void) /* TODO * Remove all settings but `-f' and `-C' */ +__attribute__((noreturn)) static void exit_usage (int status) { printf ("Usage: "PACKAGE_NAME" [OPTIONS]\n\n" -- 2.30.2