int operating_mode;
#endif
-static void sigIntHandler (int signal)
+static void
+sigIntHandler (int signal)
{
loop++;
}
-static int change_basedir (char *dir)
+static int
+change_basedir (char *dir)
{
int dirlen = strlen (dir);
} /* static int change_basedir (char *dir) */
#ifdef HAVE_LIBKSTAT
-static void update_kstat (void)
+static void
+update_kstat (void)
{
if (kc == NULL)
{
} /* static void update_kstat (void) */
#endif /* HAVE_LIBKSTAT */
-static void exit_usage (char *name)
+static void
+exit_usage (char *name)
{
printf ("Usage: "PACKAGE" [OPTIONS]\n\n"
"Available options:\n"
" General:\n"
- /*
" -C <file> Configuration file.\n"
" Default: "CONFIGFILE"\n"
+ /* sure you want a configFILE?
+ what about a configDIR? - niki */
+ /*
+ " -C <dir> Configuration directory.\n"
+ " Default: "CONFIGDIR"\n"
*/
#if COLLECT_DAEMON
" -P <file> PID file.\n"
exit (0);
} /* static void exit_usage (char *name) */
-static int start_client (void)
+static int
+start_client (void)
{
int sleepingtime;
} /* static int start_client (void) */
#ifdef HAVE_LIBRRD
-static int start_server (void)
+static int
+start_server (void)
{
char *host;
char *type;
#endif /* HAVE_LIBRRD */
#if COLLECT_DAEMON
-static int pidfile_create (char *file)
+static int
+pidfile_create (const char *file)
{
FILE *fh;
fclose(fh);
return (0);
-} /* static int pidfile_create (char *file) */
+} /* static int pidfile_create (const char *file) */
#endif /* COLLECT_DAEMON */
#if COLLECT_DAEMON
-static int pidfile_remove (void)
+static int
+pidfile_remove (const char *file)
{
- return (unlink (PIDFILE));
-} /* static int pidfile_remove (void) */
+ if (file == NULL) {
+ file = PIDFILE;
+ }
+ return (unlink (file));
+} /* static int pidfile_remove (const char *file) */
#endif /* COLLECT_DAEMON */
-int main (int argc, char **argv)
+int
+main (int argc, char **argv)
{
struct sigaction sigIntAction, sigChldAction;
char *configfile = CONFIGFILE;
+/* or char *configdir = CONFIGDIR; */
char *plugindir = PLUGINDIR;
char *datadir = PKGLOCALSTATEDIR;
#if COLLECT_DAEMON
#endif /* HAVE_LIBRRD */
case 'C':
configfile = optarg;
+ /* configdir = optarg; */
break;
#if COLLECT_DAEMON
case 'P':
#if COLLECT_DAEMON
if (daemonize)
- pidfile_remove();
+ pidfile_remove(pidfile);
#endif /* COLLECT_DAEMON */
return (0);
-}
+} /* int main (int argc, char **argv) */