From: Christian Grothoff Date: Mon, 26 Oct 2015 15:16:35 +0000 (+0000) Subject: -truncate on write X-Git-Tag: initial-import-from-subversion-38251~1205 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=41e2e7b831d4e2ad2811e48eed2fb9920b18ea49;p=oweals%2Fgnunet.git -truncate on write --- 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 @@ #include "gnunet_hello_lib.h" /** - * Closure for 'add_to_buf'. + * Closure for #add_to_buf(). */ struct AddContext { @@ -190,7 +190,7 @@ main (int argc, char *argv[]) GNUNET_HELLO_is_friend_only (orig)); GNUNET_assert (NULL != result); fh = GNUNET_DISK_file_open (argv[1], - GNUNET_DISK_OPEN_WRITE, + GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_TRUNCATE, GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); if (NULL == fh) { @@ -215,7 +215,10 @@ main (int argc, char *argv[]) } GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); } - FPRINTF (stderr, _("Modified %u addresses \n"), address_count); + FPRINTF (stderr, + _("Modified %u addresses, wrote %u bytes\n"), + address_count, + (unsigned int) fsize); return 0; }