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/fs/test_fs_download.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/fs/test_fs_download.c')
-rw-r--r-- | src/fs/test_fs_download.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 2be2e7f6a..2fe0da77c 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -299,8 +299,11 @@ run (void *cls, | |||
299 | "USE_INDEX")) | 299 | "USE_INDEX")) |
300 | { | 300 | { |
301 | fn1 = GNUNET_DISK_mktemp ("gnunet-download-indexed-test"); | 301 | fn1 = GNUNET_DISK_mktemp ("gnunet-download-indexed-test"); |
302 | GNUNET_assert (FILESIZE == | 302 | (void) GNUNET_DISK_directory_remove (fn1); |
303 | GNUNET_DISK_fn_write (fn1, buf, FILESIZE, | 303 | GNUNET_assert (GNUNET_OK == |
304 | GNUNET_DISK_fn_write (fn1, | ||
305 | buf, | ||
306 | FILESIZE, | ||
304 | GNUNET_DISK_PERM_USER_READ | 307 | GNUNET_DISK_PERM_USER_READ |
305 | | GNUNET_DISK_PERM_USER_WRITE)); | 308 | | GNUNET_DISK_PERM_USER_WRITE)); |
306 | GNUNET_free (buf); | 309 | GNUNET_free (buf); |