diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-26 15:16:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-26 15:16:35 +0000 |
commit | 41e2e7b831d4e2ad2811e48eed2fb9920b18ea49 (patch) | |
tree | 084ee992716c4120fd3c44d0befa42f147d58cb4 /src/hello | |
parent | 019a74602c855ecde0fadeb74176401a3b4ec01c (diff) | |
download | gnunet-41e2e7b831d4e2ad2811e48eed2fb9920b18ea49.tar.gz gnunet-41e2e7b831d4e2ad2811e48eed2fb9920b18ea49.zip |
-truncate on write
Diffstat (limited to 'src/hello')
-rw-r--r-- | src/hello/gnunet-hello.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c index 62977b04a..d0fd1f14d 100644 --- a/src/hello/gnunet-hello.c +++ b/src/hello/gnunet-hello.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "gnunet_hello_lib.h" | 27 | #include "gnunet_hello_lib.h" |
28 | 28 | ||
29 | /** | 29 | /** |
30 | * Closure for 'add_to_buf'. | 30 | * Closure for #add_to_buf(). |
31 | */ | 31 | */ |
32 | struct AddContext | 32 | struct AddContext |
33 | { | 33 | { |
@@ -190,7 +190,7 @@ main (int argc, char *argv[]) | |||
190 | GNUNET_HELLO_is_friend_only (orig)); | 190 | GNUNET_HELLO_is_friend_only (orig)); |
191 | GNUNET_assert (NULL != result); | 191 | GNUNET_assert (NULL != result); |
192 | fh = GNUNET_DISK_file_open (argv[1], | 192 | fh = GNUNET_DISK_file_open (argv[1], |
193 | GNUNET_DISK_OPEN_WRITE, | 193 | GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_TRUNCATE, |
194 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); | 194 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); |
195 | if (NULL == fh) | 195 | if (NULL == fh) |
196 | { | 196 | { |
@@ -215,7 +215,10 @@ main (int argc, char *argv[]) | |||
215 | } | 215 | } |
216 | GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); | 216 | GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); |
217 | } | 217 | } |
218 | FPRINTF (stderr, _("Modified %u addresses \n"), address_count); | 218 | FPRINTF (stderr, |
219 | _("Modified %u addresses, wrote %u bytes\n"), | ||
220 | address_count, | ||
221 | (unsigned int) fsize); | ||
219 | return 0; | 222 | return 0; |
220 | } | 223 | } |
221 | 224 | ||