X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-tdb1-3G-file.c;h=43e9f2ad9bd831f847acfe954ab3e6305315b207;hp=6121b4de48f7ee35693b220d9e5729d2dad4269f;hb=60210a73ec08a7b34ba637ad19e6749cf6dc1952;hpb=8a47d50d72ea62e378dc92b150c92c1317c73fa3 diff --git a/ccan/tdb2/test/run-tdb1-3G-file.c b/ccan/tdb2/test/run-tdb1-3G-file.c index 6121b4de..43e9f2ad 100644 --- a/ccan/tdb2/test/run-tdb1-3G-file.c +++ b/ccan/tdb2/test/run-tdb1-3G-file.c @@ -15,12 +15,12 @@ static int tdb1_expand_file_sparse(struct tdb1_context *tdb, return -1; } - if (ftruncate(tdb->fd, size+addition) == -1) { + if (ftruncate(tdb->file->fd, size+addition) == -1) { char b = 0; - ssize_t written = pwrite(tdb->fd, &b, 1, (size+addition) - 1); + ssize_t written = pwrite(tdb->file->fd, &b, 1, (size+addition) - 1); if (written == 0) { /* try once more, potentially revealing errno */ - written = pwrite(tdb->fd, &b, 1, (size+addition) - 1); + written = pwrite(tdb->file->fd, &b, 1, (size+addition) - 1); } if (written == 0) { /* again - give up, guessing errno */ @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) struct tdb1_record rec; plan_tests(24); - tdb = tdb1_open_ex("run-36-file.tdb", 1024, TDB1_CLEAR_IF_FIRST, + tdb = tdb1_open_ex("run-36-file.tdb", 1024, TDB_DEFAULT, O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL); ok1(tdb);