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/test_disk.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/test_disk.c')
-rw-r--r-- | src/util/test_disk.c | 4 |
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 | ||
32 | static int | 32 | static int |
33 | testReadWrite () | 33 | testReadWrite (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)) |