diff options
Diffstat (limited to 'lib/tdb/test/run-corrupt.c')
-rw-r--r-- | lib/tdb/test/run-corrupt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/tdb/test/run-corrupt.c b/lib/tdb/test/run-corrupt.c index 584f789bf8..1a3c769183 100644 --- a/lib/tdb/test/run-corrupt.c +++ b/lib/tdb/test/run-corrupt.c @@ -41,11 +41,15 @@ static void tdb_flip_bit(struct tdb_context *tdb, unsigned int bit) ((unsigned char *)tdb->map_ptr)[off] ^= mask; else { unsigned char c; - if (pread(tdb->fd, &c, 1, off) != 1) - err(1, "pread"); + if (pread(tdb->fd, &c, 1, off) != 1) { + fprintf(stderr, "pread: %s\n", strerror(errno)); + exit(1); + } c ^= mask; - if (pwrite(tdb->fd, &c, 1, off) != 1) - err(1, "pwrite"); + if (pwrite(tdb->fd, &c, 1, off) != 1) { + fprintf(stderr, "pwrite: %s\n", strerror(errno)); + exit(1); + } } } |