summaryrefslogtreecommitdiffstats
path: root/src/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/run.c')
-rw-r--r--src/run.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/run.c b/src/run.c
index 0411fcb..ebf4b3c 100644
--- a/src/run.c
+++ b/src/run.c
@@ -85,20 +85,16 @@ void local_handler(int fd, void *data)
dlog(STATE(log), LOG_WARNING, "unknown local request %d", type);
}
-int init(int mode)
+int init(void)
{
- switch(mode) {
- case STATS_MODE:
- STATE(mode) = &stats_mode;
- break;
- case SYNC_MODE:
- STATE(mode) = &sync_mode;
- break;
- default:
- fprintf(stderr, "Unknown running mode! default "
- "to synchronization mode\n");
- STATE(mode) = &sync_mode;
- break;
+ if (CONFIG(flags) & CTD_STATS_MODE)
+ STATE(mode) = &stats_mode;
+ else if (CONFIG(flags) & CTD_SYNC_MODE)
+ STATE(mode) = &sync_mode;
+ else {
+ fprintf(stderr, "WARNING: No running mode specified. "
+ "Defaulting to statistics mode.\n");
+ STATE(mode) = &stats_mode;
}
/* Initialization */