gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22892 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r22892 - gnunet/src/util
Date: Wed, 25 Jul 2012 10:43:49 +0200

Author: grothoff
Date: 2012-07-25 10:43:49 +0200 (Wed, 25 Jul 2012)
New Revision: 22892

Modified:
   gnunet/src/util/container_bloomfilter.c
Log:
-check return value

Modified: gnunet/src/util/container_bloomfilter.c
===================================================================
--- gnunet/src/util/container_bloomfilter.c     2012-07-25 08:42:42 UTC (rev 
22891)
+++ gnunet/src/util/container_bloomfilter.c     2012-07-25 08:43:49 UTC (rev 
22892)
@@ -231,7 +231,7 @@
 decrementBit (char *bitArray, unsigned int bitIdx,
               const struct GNUNET_DISK_FileHandle *fh)
 {
-  OFF_T fileSlot;
+  OFF_T fileslot;
   unsigned char value;
   unsigned int high;
   unsigned int low;
@@ -240,9 +240,13 @@
   if (GNUNET_DISK_handle_invalid (fh))
     return;                     /* cannot decrement! */
   /* Each char slot in the counter file holds two 4 bit counters */
-  fileSlot = bitIdx / 2;
+  fileslot = bitIdx / 2;
   targetLoc = bitIdx % 2;
-  GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET);
+  if (GNUNET_SYSERR == GNUNET_DISK_file_seek (fh, fileslot, 
GNUNET_DISK_SEEK_SET))
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "seek");
+      return;
+    }
   if (1 != GNUNET_DISK_file_read (fh, &value, 1))
     value = 0;
   low = value & 0xF;
@@ -268,7 +272,11 @@
     }
   }
   value = ((high << 4) | low);
-  GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET);
+  if (GNUNET_SYSERR == GNUNET_DISK_file_seek (fh, fileslot, 
GNUNET_DISK_SEEK_SET))
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "seek");
+      return;
+    }
   GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]