commit 6ece270b1f87ef98a9df8ee6a4c08db4a131b8b9
parent a9a6b98c54f5cc3e680c8ea2f9c69e3955e2a7da
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 28 Feb 2017 19:56:37 +0100
get rid of warning for missing directory on friends.txt creation
Diffstat:
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/topology/friends.c b/src/topology/friends.c
@@ -58,14 +58,20 @@ GNUNET_FRIENDS_parse (const struct GNUNET_CONFIGURATION_Handle *cfg,
return GNUNET_SYSERR;
}
if ( (GNUNET_OK != GNUNET_DISK_file_test (fn)) &&
- (GNUNET_OK != GNUNET_DISK_fn_write (fn, NULL, 0,
+ (GNUNET_OK != GNUNET_DISK_fn_write (fn,
+ NULL,
+ 0,
GNUNET_DISK_PERM_USER_READ |
- GNUNET_DISK_PERM_USER_WRITE)) )
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn);
+ GNUNET_DISK_PERM_USER_WRITE |
+ GNUNET_DISK_OPEN_CREATE)) )
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+ "write",
+ fn);
if ( (GNUNET_OK !=
GNUNET_DISK_file_size (fn,
&fsize,
- GNUNET_NO, GNUNET_YES)) ||
+ GNUNET_NO,
+ GNUNET_YES)) ||
(0 == fsize) )
{
GNUNET_free (fn);
@@ -93,8 +99,8 @@ GNUNET_FRIENDS_parse (const struct GNUNET_CONFIGURATION_Handle *cfg,
pos++;
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_public_key_from_string (&data[start],
- pos - start,
- &pid.public_key))
+ pos - start,
+ &pid.public_key))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Syntax error in FRIENDS file at offset %llu, skipping bytes `%.*s'.\n"),