From 6ece270b1f87ef98a9df8ee6a4c08db4a131b8b9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 28 Feb 2017 19:56:37 +0100 Subject: [PATCH] get rid of warning for missing directory on friends.txt creation --- src/topology/friends.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/topology/friends.c b/src/topology/friends.c index 59c70e4b0..a960fad17 100644 --- 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"), -- 2.25.1