diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-06-16 22:57:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-06-16 22:57:50 +0000 |
commit | 20945e0603fd6817a87165a9b471654130cb6d67 (patch) | |
tree | 68e9cdaeffdfb54949aaba7c469176cef4019e15 /src/util/container_bloomfilter.c | |
parent | b6bda27ce9a134c78c6084393b3370bf3691f206 (diff) | |
download | gnunet-20945e0603fd6817a87165a9b471654130cb6d67.tar.gz gnunet-20945e0603fd6817a87165a9b471654130cb6d67.zip |
fixing testcases with new disk API
Diffstat (limited to 'src/util/container_bloomfilter.c')
-rw-r--r-- | src/util/container_bloomfilter.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index 7eb910270..cec686795 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -406,10 +406,10 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, unsigned int size, | |||
406 | /* Try to open a bloomfilter file */ | 406 | /* Try to open a bloomfilter file */ |
407 | if (filename != NULL) | 407 | if (filename != NULL) |
408 | { | 408 | { |
409 | bf->fh = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_WRITE | 409 | bf->fh = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READWRITE |
410 | | GNUNET_DISK_OPEN_READ | GNUNET_DISK_OPEN_CREATE, | 410 | | GNUNET_DISK_OPEN_CREATE, |
411 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); | 411 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); |
412 | if (!bf->fh) | 412 | if (NULL == bf->fh) |
413 | { | 413 | { |
414 | GNUNET_free (bf); | 414 | GNUNET_free (bf); |
415 | return NULL; | 415 | return NULL; |
@@ -437,6 +437,12 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, unsigned int size, | |||
437 | int res; | 437 | int res; |
438 | 438 | ||
439 | res = GNUNET_DISK_file_read (bf->fh, rbuff, BUFFSIZE); | 439 | res = GNUNET_DISK_file_read (bf->fh, rbuff, BUFFSIZE); |
440 | if (res == -1) | ||
441 | { | ||
442 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | ||
443 | "read", | ||
444 | bf->filename); | ||
445 | } | ||
440 | if (res == 0) | 446 | if (res == 0) |
441 | break; /* is ok! we just did not use that many bits yet */ | 447 | break; /* is ok! we just did not use that many bits yet */ |
442 | for (i = 0; i < res; i++) | 448 | for (i = 0; i < res; i++) |