summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb3e431)
raw | patch | inline | side by side (parent: bb3e431)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 10 Dec 2008 21:12:24 +0000 (22:12 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 11 Dec 2008 01:05:05 +0000 (02:05 +0100) |
In case of an error, the exit status code now equals 1.
src/collectd.c | patch | blob | history |
diff --git a/src/collectd.c b/src/collectd.c
index e8aaed2b21a87352dc10ae11fb201c7a9e35570c..d6ec81a77e86b1d80851f31956014cda010ba8b2 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
/* TODO
* Remove all settings but `-f' and `-C'
*/
-static void exit_usage (void)
+static void exit_usage (int status)
{
printf ("Usage: "PACKAGE" [OPTIONS]\n\n"
"\n"PACKAGE" "VERSION", http://collectd.org/\n"
"by Florian octo Forster <octo@verplant.org>\n"
"for contributions see `AUTHORS'\n");
- exit (0);
-} /* static void exit_usage (char *name) */
+ exit (status);
+} /* static void exit_usage (int status) */
static int do_init (void)
{
break;
#endif /* COLLECT_DAEMON */
case 'h':
+ exit_usage (0);
+ break;
default:
- exit_usage ();
+ exit_usage (1);
} /* switch (c) */
} /* while (1) */
if (optind < argc)
- exit_usage ();
+ exit_usage (1);
/*
* Read options from the config file, the environment and the command