aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_unindex.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.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.c')
-rw-r--r--src/fs/test_fs_unindex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index a11c574c1..992672244 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -197,7 +197,8 @@ run (void *cls,
197 buf = GNUNET_malloc (FILESIZE); 197 buf = GNUNET_malloc (FILESIZE);
198 for (i = 0; i < FILESIZE; i++) 198 for (i = 0; i < FILESIZE; i++)
199 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); 199 buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256);
200 GNUNET_assert (FILESIZE == 200 (void) GNUNET_DISK_directory_remove (fn);
201 GNUNET_assert (GNUNET_OK ==
201 GNUNET_DISK_fn_write (fn, buf, FILESIZE, 202 GNUNET_DISK_fn_write (fn, buf, FILESIZE,
202 GNUNET_DISK_PERM_USER_READ 203 GNUNET_DISK_PERM_USER_READ
203 | GNUNET_DISK_PERM_USER_WRITE)); 204 | GNUNET_DISK_PERM_USER_WRITE));