tdb: finish weaning off err.h.
[samba.git] / lib / tdb / test / run-corrupt.c
index 584f789bf8078ae7387849aa0aa8479cd94613e3..1a3c769183243aad665e77784c1fb129d5b4ffe3 100644 (file)
@@ -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);
+               }
        }
 }