summaryrefslogtreecommitdiff
path: root/src/tools/cbr/cbr.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-21 21:12:03 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-21 21:12:03 +0200
commitf0d4305c067044e74c44032c32ce6c4db3c6fffa (patch)
treed895b25fb5a8f7af106c6c2d3228b62ade81b3b4 /src/tools/cbr/cbr.c
parentba27593e3e8406e109393ae383f17c7416675c1e (diff)
parentcee5ae97ee14438b2dabc06bfad9b02e42e4d816 (diff)
downloadouroboros-f0d4305c067044e74c44032c32ce6c4db3c6fffa.tar.gz
ouroboros-f0d4305c067044e74c44032c32ce6c4db3c6fffa.zip
Merged in dstaesse/ouroboros/be-irmd-refactor (pull request #213)
irmd, lib: Rebuild the IRMd data model
Diffstat (limited to 'src/tools/cbr/cbr.c')
-rw-r--r--src/tools/cbr/cbr.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tools/cbr/cbr.c b/src/tools/cbr/cbr.c
index 65783119..e42492df 100644
--- a/src/tools/cbr/cbr.c
+++ b/src/tools/cbr/cbr.c
@@ -72,14 +72,10 @@ int main(int argc, char ** argv)
int ret = 0;
char * rem = NULL;
char * s_apn = NULL;
+ char ** argv_dup = argv;
bool server = false;
- if (ap_init(argv[0]) < 0) {
- printf("Failed to init.\n");
- exit(EXIT_FAILURE);
- }
-
server_settings.interval = 1; /* One second reporting interval */
server_settings.timeout = 1;
@@ -133,8 +129,18 @@ int main(int argc, char ** argv)
}
if (server) {
+ if (ap_init(argv_dup[0]) < 0) {
+ printf("Failed to init.\n");
+ exit(EXIT_FAILURE);
+ }
+
ret = server_main();
} else {
+ if (ap_init(NULL) < 0) {
+ printf("Failed to init.\n");
+ exit(EXIT_FAILURE);
+ }
+
if (s_apn == NULL) {
printf("No server specified.\n");
usage();