#include <ccan/tdb/error.c>
#include <ccan/tdb/open.c>
#include <ccan/tdb/check.c>
+#include <ccan/tdb/hash.c>
#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <err.h>
((unsigned char *)tdb->map_ptr)[off] ^= mask;
else {
unsigned char c;
- pread(tdb->fd, &c, 1, off);
+ if (pread(tdb->fd, &c, 1, off) != 1)
+ err(1, "pread");
c ^= mask;
- pwrite(tdb->fd, &c, 1, off);
+ if (pwrite(tdb->fd, &c, 1, off) != 1)
+ err(1, "pwrite");
}
}