diff options
Diffstat (limited to 'src/peerinfo/gnunet-service-peerinfo.c')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 66082e8f7..8be6cf5ab 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -338,12 +338,12 @@ read_host_file (const char *fn, | |||
338 | struct ReadHostFileContext *r) | 338 | struct ReadHostFileContext *r) |
339 | { | 339 | { |
340 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; | 340 | char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; |
341 | unsigned int size_total; | 341 | ssize_t size_total; |
342 | struct GNUNET_TIME_Absolute now; | 342 | struct GNUNET_TIME_Absolute now; |
343 | unsigned int left; | 343 | unsigned int left; |
344 | const struct GNUNET_HELLO_Message *hello; | 344 | const struct GNUNET_HELLO_Message *hello; |
345 | struct GNUNET_HELLO_Message *hello_clean; | 345 | struct GNUNET_HELLO_Message *hello_clean; |
346 | unsigned read_pos; | 346 | size_t read_pos; |
347 | int size_hello; | 347 | int size_hello; |
348 | 348 | ||
349 | r->friend_only_hello = NULL; | 349 | r->friend_only_hello = NULL; |
@@ -1005,6 +1005,7 @@ discard_hosts_helper (void *cls, | |||
1005 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | | 1005 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | |
1006 | GNUNET_ERROR_TYPE_BULK, | 1006 | GNUNET_ERROR_TYPE_BULK, |
1007 | "unlink", fn); | 1007 | "unlink", fn); |
1008 | GNUNET_free (writebuffer); | ||
1008 | return GNUNET_OK; | 1009 | return GNUNET_OK; |
1009 | } | 1010 | } |
1010 | new_hello = GNUNET_HELLO_iterate_addresses (hello, | 1011 | new_hello = GNUNET_HELLO_iterate_addresses (hello, |
@@ -1028,11 +1029,13 @@ discard_hosts_helper (void *cls, | |||
1028 | 1029 | ||
1029 | if (0 < write_pos) | 1030 | if (0 < write_pos) |
1030 | { | 1031 | { |
1031 | GNUNET_DISK_fn_write (fn, writebuffer,write_pos, | 1032 | GNUNET_DISK_fn_write (fn, |
1032 | GNUNET_DISK_PERM_USER_READ | | 1033 | writebuffer, |
1033 | GNUNET_DISK_PERM_USER_WRITE | | 1034 | write_pos, |
1034 | GNUNET_DISK_PERM_GROUP_READ | | 1035 | GNUNET_DISK_PERM_USER_READ | |
1035 | GNUNET_DISK_PERM_OTHER_READ); | 1036 | GNUNET_DISK_PERM_USER_WRITE | |
1037 | GNUNET_DISK_PERM_GROUP_READ | | ||
1038 | GNUNET_DISK_PERM_OTHER_READ); | ||
1036 | } | 1039 | } |
1037 | else if (0 != UNLINK (fn)) | 1040 | else if (0 != UNLINK (fn)) |
1038 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | | 1041 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | |