From 6d8512e66e78b06e4d92b1caec44dd68e8605276 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 16 Feb 2014 15:22:57 +0000 Subject: [PATCH] make sure to create friends directory before trying to write friends file --- src/topology/friends.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/topology/friends.c b/src/topology/friends.c index 6c680b7a0..f79ee77ca 100644 --- a/src/topology/friends.c +++ b/src/topology/friends.c @@ -147,6 +147,14 @@ GNUNET_FRIENDS_write_start (const struct GNUNET_CONFIGURATION_Handle *cfg) "topology", "FRIENDS"); return NULL; } + if (GNUNET_OK != + GNUNET_DISK_directory_create_for_file (fn)) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + _("Directory for file `%s' does not seem to be writable.\n"), + fn); + return NULL; + } if (GNUNET_OK == GNUNET_DISK_file_test (fn)) GNUNET_DISK_file_backup (fn); w = GNUNET_new (struct GNUNET_FRIENDS_Writer); -- 2.25.1