diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-12-19 18:43:38 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-12-19 18:43:38 +0100 |
commit | 3636ea628d051cf2ba7a9038c50528c561d0aeaa (patch) | |
tree | 87664b904950052e8b6997a371ed5ecb1ea4b310 /src/util/gnunet-scrypt.c | |
parent | 74d7528e6bd53cf5acc939c63a5be74a001e5ce1 (diff) | |
download | gnunet-3636ea628d051cf2ba7a9038c50528c561d0aeaa.tar.gz gnunet-3636ea628d051cf2ba7a9038c50528c561d0aeaa.zip |
change GNUNET_DISK_fn_write() to always do atomic writes and to NOT overwrite existing files; also change the return value to not return the size of the written file but GNUNET_OK on success, and integrate creating the directory if needed; breaks API, hence bumping libgnunetutil version
Diffstat (limited to 'src/util/gnunet-scrypt.c')
-rw-r--r-- | src/util/gnunet-scrypt.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c index 136c6debb..5c3dfc12e 100644 --- a/src/util/gnunet-scrypt.c +++ b/src/util/gnunet-scrypt.c | |||
@@ -65,12 +65,15 @@ static void | |||
65 | shutdown_task (void *cls) | 65 | shutdown_task (void *cls) |
66 | { | 66 | { |
67 | (void) cls; | 67 | (void) cls; |
68 | if (sizeof(proof) != GNUNET_DISK_fn_write (pwfn, | 68 | if (GNUNET_OK != |
69 | &proof, | 69 | GNUNET_DISK_fn_write (pwfn, |
70 | sizeof(proof), | 70 | &proof, |
71 | GNUNET_DISK_PERM_USER_READ | 71 | sizeof(proof), |
72 | | GNUNET_DISK_PERM_USER_WRITE)) | 72 | GNUNET_DISK_PERM_USER_READ |
73 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", pwfn); | 73 | | GNUNET_DISK_PERM_USER_WRITE)) |
74 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | ||
75 | "write", | ||
76 | pwfn); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | 79 | ||