aboutsummaryrefslogtreecommitdiff
path: root/src/util/program.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-12-12 13:42:16 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-12-12 13:42:16 +0000
commit973e714d90c5231aedb8e0a594043c2113d85269 (patch)
treedf730ea097e831e48ce6bee4b0abd41308009f52 /src/util/program.c
parent66b5a9c821fd60bdc27612e0387d348416e694e0 (diff)
downloadgnunet-973e714d90c5231aedb8e0a594043c2113d85269.tar.gz
gnunet-973e714d90c5231aedb8e0a594043c2113d85269.zip
do not start with malformed configuration
Diffstat (limited to 'src/util/program.c')
-rw-r--r--src/util/program.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/util/program.c b/src/util/program.c
index fa22080c1..930b93422 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -253,10 +253,23 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
253 cc.cfgfile = GNUNET_strdup (cfg_fn); 253 cc.cfgfile = GNUNET_strdup (cfg_fn);
254 if (GNUNET_YES == 254 if (GNUNET_YES ==
255 GNUNET_DISK_file_test (cc.cfgfile)) 255 GNUNET_DISK_file_test (cc.cfgfile))
256 (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile); 256 {
257 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, cc.cfgfile))
258 {
259 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
260 _("Malformed configuration file `%s', exit ...\n"),
261 cc.cfgfile);
262 return GNUNET_SYSERR;
263 }
264 }
257 else 265 else
258 { 266 {
259 (void) GNUNET_CONFIGURATION_load (cfg, NULL); 267 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, NULL))
268 {
269 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
270 _("Malformed configuration, exit ...\n"));
271 return GNUNET_SYSERR;
272 }
260 if (0 != strcmp (cc.cfgfile, cfg_fn)) 273 if (0 != strcmp (cc.cfgfile, cfg_fn))
261 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 274 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
262 _("Could not access configuration file `%s'\n"), 275 _("Could not access configuration file `%s'\n"),