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;
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;
}
}
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));
}