diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-05 13:41:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-05 13:41:43 +0000 |
commit | dbda573e46ee3537f97320de1936a313100ce03e (patch) | |
tree | ea54b95245c53306a89352959bc818c139e8343a /src/util/service.c | |
parent | 4562b4f0679c784be5e7af59f3aec3c0d5de3fb5 (diff) | |
download | gnunet-dbda573e46ee3537f97320de1936a313100ce03e.tar.gz gnunet-dbda573e46ee3537f97320de1936a313100ce03e.zip |
-allow config-less services to run
Diffstat (limited to 'src/util/service.c')
-rw-r--r-- | src/util/service.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/util/service.c b/src/util/service.c index 67d8583cc..8b779c61d 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -1778,8 +1778,17 @@ GNUNET_SERVICE_run (int argc, char *const *argv, const char *service_name, | |||
1778 | } | 1778 | } |
1779 | if (GNUNET_OK != GNUNET_log_setup (service_name, loglev, logfile)) | 1779 | if (GNUNET_OK != GNUNET_log_setup (service_name, loglev, logfile)) |
1780 | HANDLE_ERROR; | 1780 | HANDLE_ERROR; |
1781 | if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfg_fn)) | 1781 | if (GNUNET_YES == |
1782 | goto shutdown; | 1782 | GNUNET_DISK_file_test (cfg_fn)) |
1783 | (void) GNUNET_CONFIGURATION_load (cfg, cfg_fn); | ||
1784 | else | ||
1785 | { | ||
1786 | (void) GNUNET_CONFIGURATION_load (cfg, NULL); | ||
1787 | if (0 != strcmp (cfg_fn, GNUNET_DEFAULT_USER_CONFIG_FILE)) | ||
1788 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1789 | _("Could not access configuration file `%s'\n"), | ||
1790 | cfg_fn); | ||
1791 | } | ||
1783 | if (GNUNET_OK != setup_service (&sctx)) | 1792 | if (GNUNET_OK != setup_service (&sctx)) |
1784 | goto shutdown; | 1793 | goto shutdown; |
1785 | if ((1 == do_daemonize) && (GNUNET_OK != detach_terminal (&sctx))) | 1794 | if ((1 == do_daemonize) && (GNUNET_OK != detach_terminal (&sctx))) |