aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-12-12 13:36:21 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-12-12 13:36:21 +0000
commit66b5a9c821fd60bdc27612e0387d348416e694e0 (patch)
tree9b8f478b40ddc1a703960d26e0e6ac4e7d8bec8d /src/util
parent7c80255561ecb8fae2906cb123dde10abfbaa6bb (diff)
downloadgnunet-66b5a9c821fd60bdc27612e0387d348416e694e0.tar.gz
gnunet-66b5a9c821fd60bdc27612e0387d348416e694e0.zip
fail to start service if we have a malformed configuration
Diffstat (limited to 'src/util')
-rw-r--r--src/util/service.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/util/service.c b/src/util/service.c
index 752dd2a74..3c9a023cb 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1441,12 +1441,24 @@ GNUNET_SERVICE_run (int argc, char *const *argv,
1441 HANDLE_ERROR; 1441 HANDLE_ERROR;
1442 if (NULL == opt_cfg_fn) 1442 if (NULL == opt_cfg_fn)
1443 opt_cfg_fn = GNUNET_strdup (cfg_fn); 1443 opt_cfg_fn = GNUNET_strdup (cfg_fn);
1444 if (GNUNET_YES == 1444 if (GNUNET_YES == GNUNET_DISK_file_test (opt_cfg_fn))
1445 GNUNET_DISK_file_test (opt_cfg_fn)) 1445 {
1446 (void) GNUNET_CONFIGURATION_load (cfg, opt_cfg_fn); 1446 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, opt_cfg_fn))
1447 {
1448 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1449 _("Malformed configuration file `%s', exit ...\n"),
1450 opt_cfg_fn);
1451 goto shutdown;
1452 }
1453 }
1447 else 1454 else
1448 { 1455 {
1449 (void) GNUNET_CONFIGURATION_load (cfg, NULL); 1456 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, NULL))
1457 {
1458 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1459 _("Malformed configuration, exit ...\n"));
1460 goto shutdown;
1461 }
1450 if (0 != strcmp (opt_cfg_fn, cfg_fn)) 1462 if (0 != strcmp (opt_cfg_fn, cfg_fn))
1451 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1463 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1452 _("Could not access configuration file `%s'\n"), 1464 _("Could not access configuration file `%s'\n"),