aboutsummaryrefslogtreecommitdiff
path: root/src/lib/eventloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eventloop.c')
-rw-r--r--src/lib/eventloop.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c
index c6a9fd8f..de3c315a 100644
--- a/src/lib/eventloop.c
+++ b/src/lib/eventloop.c
@@ -828,6 +828,7 @@ run_main_loop (void *cls, char *const *args, const char *cfgfile,
828 struct GNUNET_GTK_MainLoop *ml = cls; 828 struct GNUNET_GTK_MainLoop *ml = cls;
829 struct GNUNET_CONFIGURATION_Handle *gcfg; 829 struct GNUNET_CONFIGURATION_Handle *gcfg;
830 char *baseconfig; 830 char *baseconfig;
831 char *ipath2;
831 char *ipath; 832 char *ipath;
832 int argc; 833 int argc;
833 834
@@ -838,16 +839,31 @@ run_main_loop (void *cls, char *const *args, const char *cfgfile,
838 gtk_init (&argc, (char ***) &args); 839 gtk_init (&argc, (char ***) &args);
839 gcfg = GNUNET_CONFIGURATION_create (); 840 gcfg = GNUNET_CONFIGURATION_create ();
840 841
841 ipath = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR); 842 if (NULL == (ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR)))
842 if (ipath == NULL)
843 { 843 {
844 GNUNET_break (0); 844 GNUNET_break (0);
845 return; 845 return;
846 } 846 }
847 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d"); 847 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
848 GNUNET_free (ipath);
849 (void) GNUNET_CONFIGURATION_load_from (gcfg, baseconfig); 848 (void) GNUNET_CONFIGURATION_load_from (gcfg, baseconfig);
850 GNUNET_free (baseconfig); 849 GNUNET_free (baseconfig);
850
851 if (NULL == (ipath2 = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR)))
852 {
853 GNUNET_break (0);
854 return;
855 }
856 if (0 != strcmp (ipath, ipath2))
857 {
858 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
859 if (GNUNET_YES ==
860 GNUNET_DISK_directory_test (baseconfig, GNUNET_YES))
861 (void) GNUNET_CONFIGURATION_load_from (gcfg, baseconfig);
862 GNUNET_free (baseconfig);
863 }
864 GNUNET_free (ipath2);
865 GNUNET_free (ipath);
866
851 (void) GNUNET_CONFIGURATION_load (gcfg, cfgfile); 867 (void) GNUNET_CONFIGURATION_load (gcfg, cfgfile);
852 ml->rs = GNUNET_NETWORK_fdset_create (); 868 ml->rs = GNUNET_NETWORK_fdset_create ();
853 ml->ws = GNUNET_NETWORK_fdset_create (); 869 ml->ws = GNUNET_NETWORK_fdset_create ();