aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_disk.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/util/test_disk.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/util/test_disk.c')
-rw-r--r--src/util/test_disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index 6969e49e6..12bde8107 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -30,12 +30,12 @@
30 30
31 31
32static int 32static int
33testReadWrite () 33testReadWrite (void)
34{ 34{
35 char tmp[100 + 1]; 35 char tmp[100 + 1];
36 int ret; 36 int ret;
37 37
38 if (strlen (TESTSTRING) != 38 if (GNUNET_OK !=
39 GNUNET_DISK_fn_write (".testfile", TESTSTRING, strlen (TESTSTRING), 39 GNUNET_DISK_fn_write (".testfile", TESTSTRING, strlen (TESTSTRING),
40 GNUNET_DISK_PERM_USER_READ 40 GNUNET_DISK_PERM_USER_READ
41 | GNUNET_DISK_PERM_USER_WRITE)) 41 | GNUNET_DISK_PERM_USER_WRITE))