diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-02-16 15:22:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-02-16 15:22:57 +0000 |
commit | 6d8512e66e78b06e4d92b1caec44dd68e8605276 (patch) | |
tree | d7260730f4d97b7377e27a62b2970d171eef6b73 /src/topology | |
parent | 9df90067e4904291d7e1c4acf5237c85a7c9387c (diff) | |
download | gnunet-6d8512e66e78b06e4d92b1caec44dd68e8605276.tar.gz gnunet-6d8512e66e78b06e4d92b1caec44dd68e8605276.zip |
make sure to create friends directory before trying to write friends file
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/friends.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
147 | "topology", "FRIENDS"); | 147 | "topology", "FRIENDS"); |
148 | return NULL; | 148 | return NULL; |
149 | } | 149 | } |
150 | if (GNUNET_OK != | ||
151 | GNUNET_DISK_directory_create_for_file (fn)) | ||
152 | { | ||
153 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
154 | _("Directory for file `%s' does not seem to be writable.\n"), | ||
155 | fn); | ||
156 | return NULL; | ||
157 | } | ||
150 | if (GNUNET_OK == GNUNET_DISK_file_test (fn)) | 158 | if (GNUNET_OK == GNUNET_DISK_file_test (fn)) |
151 | GNUNET_DISK_file_backup (fn); | 159 | GNUNET_DISK_file_backup (fn); |
152 | w = GNUNET_new (struct GNUNET_FRIENDS_Writer); | 160 | w = GNUNET_new (struct GNUNET_FRIENDS_Writer); |