mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-23 21:14:28 +08:00
mdbx: merge branch master
into devel
.
This commit is contained in:
10
src/core.c
10
src/core.c
@@ -4814,8 +4814,11 @@ static int txn_spill(MDBX_txn *const txn, MDBX_cursor *const m0,
|
||||
txn->tw.dirtyroom += spilled;
|
||||
tASSERT(txn, dirtylist_check(txn));
|
||||
|
||||
if (ctx.iov_items)
|
||||
if (ctx.iov_items) {
|
||||
/* iov_page() frees dirty-pages and reset iov_items in case of failure. */
|
||||
tASSERT(txn, rc == MDBX_SUCCESS);
|
||||
rc = iov_write(txn, &ctx);
|
||||
}
|
||||
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
goto bailout;
|
||||
@@ -9903,8 +9906,11 @@ static int txn_write(MDBX_txn *txn, struct iov_ctx *ctx) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ctx->iov_items)
|
||||
if (ctx->iov_items) {
|
||||
/* iov_page() frees dirty-pages and reset iov_items in case of failure. */
|
||||
tASSERT(txn, rc == MDBX_SUCCESS);
|
||||
rc = iov_write(txn, ctx);
|
||||
}
|
||||
|
||||
while (r <= dl->length)
|
||||
dl->items[++w] = dl->items[r++];
|
||||
|
@@ -221,9 +221,12 @@ static int lck_op(const mdbx_filehandle_t fd, int cmd, const int lck,
|
||||
((uint64_t)offset + (uint64_t)len));
|
||||
for (;;) {
|
||||
struct flock lock_op;
|
||||
STATIC_ASSERT(sizeof(off_t) <= sizeof(lock_op.l_start) &&
|
||||
sizeof(off_t) <= sizeof(lock_op.l_len) &&
|
||||
OFF_T_MAX == (off_t)OFF_T_MAX);
|
||||
STATIC_ASSERT_MSG(sizeof(off_t) <= sizeof(lock_op.l_start) &&
|
||||
sizeof(off_t) <= sizeof(lock_op.l_len) &&
|
||||
OFF_T_MAX == (off_t)OFF_T_MAX,
|
||||
"Support for large/64-bit-sized files is misconfigured "
|
||||
"for the target system and/or toolchain. "
|
||||
"Please fix it or at least disable it completely.");
|
||||
memset(&lock_op, 0, sizeof(lock_op));
|
||||
lock_op.l_type = lck;
|
||||
lock_op.l_whence = SEEK_SET;
|
||||
|
Reference in New Issue
Block a user