From 9c8b4f051ae56fa7ec4b30ed45836e9715fb3cc9 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 28 Jan 2006 19:22:08 +0000 Subject: Fix compile time warnings. --- daemon/rrdbotd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'daemon/rrdbotd.c') diff --git a/daemon/rrdbotd.c b/daemon/rrdbotd.c index c28825d..261955d 100644 --- a/daemon/rrdbotd.c +++ b/daemon/rrdbotd.c @@ -42,11 +42,13 @@ #include #include #include +#include #include #include #include "rrdbotd.h" +#include "server-mainloop.h" /* The default command line options */ #define DEFAULT_CONFIG CONF_PREFIX "/rrdbot" @@ -72,11 +74,12 @@ static int debug_level = LOG_ERR; #include "mib/parse.h" +#ifdef TEST + static void test(int argc, char* argv[]) { struct snmp_value val; - mib_node n, n2; debug_level = 4; @@ -98,6 +101,8 @@ test(int argc, char* argv[]) exit(1); } +#endif /* TEST */ + /* ----------------------------------------------------------------------------- * LOGGING */ @@ -211,7 +216,10 @@ main(int argc, char* argv[]) char ch; char* t; - /* test(argc, argv); */ +#ifdef TEST + test(argc, argv); + return 1; +#endif /* Initialize the state stuff */ memset(&g_state, 0, sizeof(g_state)); @@ -310,7 +318,7 @@ main(int argc, char* argv[]) { /* Fork a daemon nicely */ if(daemon(0, 0) == -1) - err("couldn't fork as a daemon"); + err(1, "couldn't fork as a daemon"); rb_messagex(LOG_DEBUG, "running as a daemon"); daemonized = 1; -- cgit v1.2.3