From a61f7e5a34d22fbaca6473e323a8f57500c8ca92 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 20 Apr 2010 14:26:45 +0000 Subject: [PATCH] --- .../test_gnunet_daemon_hostlist_learning.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 9d45c01ae..fb9446bc4 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -206,6 +206,8 @@ static struct GNUNET_CORE_MessageHandler learn_handlers[] = { static void setup_learn_peer (struct PeerContext *p, const char *cfgname) { + char * filename; + unsigned int result; p->cfg = GNUNET_CONFIGURATION_create (); #if START_ARM p->arm_pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", @@ -216,6 +218,20 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname) "-c", cfgname, NULL); #endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); + if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (p->cfg, + "HOSTLIST", + "HOSTLISTFILE", + &filename)) + { + if ( GNUNET_YES == GNUNET_DISK_file_test (filename) ) + { + result = remove (filename); + if (result == 0) + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + _("Hostlist hostlist file `%s' was removed\n"),filename); + } + } + GNUNET_free ( filename ); GNUNET_ARM_start_services (p->cfg, sched, "core", NULL); p->core = GNUNET_CORE_connect (sched, p->cfg, -- 2.25.1