aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_unindex_persistence.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-19 18:43:38 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-19 18:43:38 +0100
commit3636ea628d051cf2ba7a9038c50528c561d0aeaa (patch)
tree87664b904950052e8b6997a371ed5ecb1ea4b310 /src/fs/test_fs_unindex_persistence.c
parent74d7528e6bd53cf5acc939c63a5be74a001e5ce1 (diff)
downloadgnunet-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/fs/test_fs_unindex_persistence.c')
-rw-r--r--src/fs/test_fs_unindex_persistence.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index c3668f4e0..802aaf7ca 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -267,7 +267,8 @@ run (void *cls,
267 buf = GNUNET_malloc (FILESIZE); 267 buf = GNUNET_malloc (FILESIZE);
268 for (i = 0; i < FILESIZE; i++) 268 for (i = 0; i < FILESIZE; i++)
269 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 269 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
270 GNUNET_assert (FILESIZE == 270 (void) GNUNET_DISK_directory_remove (fn);
271 GNUNET_assert (GNUNET_OK ==
271 GNUNET_DISK_fn_write (fn, buf, FILESIZE, 272 GNUNET_DISK_fn_write (fn, buf, FILESIZE,
272 GNUNET_DISK_PERM_USER_READ 273 GNUNET_DISK_PERM_USER_READ
273 | GNUNET_DISK_PERM_USER_WRITE)); 274 | GNUNET_DISK_PERM_USER_WRITE));