aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_bloomfilter.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-07-25 08:43:49 +0000
committerChristian Grothoff <christian@grothoff.org>2012-07-25 08:43:49 +0000
commitf4e5b024d1ef21ecad101dd3a3c65e6144d5fc65 (patch)
tree6574d3aeab0015c77a1c5a1e2ed5383016ef6c7d /src/util/container_bloomfilter.c
parente2210cc509574a93234d8c8b851fe9ed917a4e11 (diff)
downloadgnunet-f4e5b024d1ef21ecad101dd3a3c65e6144d5fc65.tar.gz
gnunet-f4e5b024d1ef21ecad101dd3a3c65e6144d5fc65.zip
-check return value
Diffstat (limited to 'src/util/container_bloomfilter.c')
-rw-r--r--src/util/container_bloomfilter.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 8d0852fc9..1a2c876f9 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -231,7 +231,7 @@ static void
231decrementBit (char *bitArray, unsigned int bitIdx, 231decrementBit (char *bitArray, unsigned int bitIdx,
232 const struct GNUNET_DISK_FileHandle *fh) 232 const struct GNUNET_DISK_FileHandle *fh)
233{ 233{
234 OFF_T fileSlot; 234 OFF_T fileslot;
235 unsigned char value; 235 unsigned char value;
236 unsigned int high; 236 unsigned int high;
237 unsigned int low; 237 unsigned int low;
@@ -240,9 +240,13 @@ decrementBit (char *bitArray, unsigned int bitIdx,
240 if (GNUNET_DISK_handle_invalid (fh)) 240 if (GNUNET_DISK_handle_invalid (fh))
241 return; /* cannot decrement! */ 241 return; /* cannot decrement! */
242 /* Each char slot in the counter file holds two 4 bit counters */ 242 /* Each char slot in the counter file holds two 4 bit counters */
243 fileSlot = bitIdx / 2; 243 fileslot = bitIdx / 2;
244 targetLoc = bitIdx % 2; 244 targetLoc = bitIdx % 2;
245 GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET); 245 if (GNUNET_SYSERR == GNUNET_DISK_file_seek (fh, fileslot, GNUNET_DISK_SEEK_SET))
246 {
247 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "seek");
248 return;
249 }
246 if (1 != GNUNET_DISK_file_read (fh, &value, 1)) 250 if (1 != GNUNET_DISK_file_read (fh, &value, 1))
247 value = 0; 251 value = 0;
248 low = value & 0xF; 252 low = value & 0xF;
@@ -268,7 +272,11 @@ decrementBit (char *bitArray, unsigned int bitIdx,
268 } 272 }
269 } 273 }
270 value = ((high << 4) | low); 274 value = ((high << 4) | low);
271 GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET); 275 if (GNUNET_SYSERR == GNUNET_DISK_file_seek (fh, fileslot, GNUNET_DISK_SEEK_SET))
276 {
277 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "seek");
278 return;
279 }
272 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); 280 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
273} 281}
274 282