|
|
@ -1271,7 +1271,7 @@ typedef struct MDB_ntxn { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** max bytes to write in one call */ |
|
|
|
/** max bytes to write in one call */ |
|
|
|
#define MAX_WRITE (0x80000000U >> (sizeof(ssize_t) == 4)) |
|
|
|
#define MAX_WRITE (0x40000000U >> (sizeof(ssize_t) == 4)) |
|
|
|
|
|
|
|
|
|
|
|
/** Check \b txn and \b dbi arguments to a function */ |
|
|
|
/** Check \b txn and \b dbi arguments to a function */ |
|
|
|
#define TXN_DBI_EXIST(txn, dbi, validity) \ |
|
|
|
#define TXN_DBI_EXIST(txn, dbi, validity) \ |
|
|
@ -9157,7 +9157,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) |
|
|
|
MDB_txn *txn = NULL; |
|
|
|
MDB_txn *txn = NULL; |
|
|
|
mdb_mutexref_t wmutex = NULL; |
|
|
|
mdb_mutexref_t wmutex = NULL; |
|
|
|
int rc; |
|
|
|
int rc; |
|
|
|
size_t wsize; |
|
|
|
size_t wsize, w3; |
|
|
|
char *ptr; |
|
|
|
char *ptr; |
|
|
|
#ifdef _WIN32 |
|
|
|
#ifdef _WIN32 |
|
|
|
DWORD len, w2; |
|
|
|
DWORD len, w2; |
|
|
@ -9216,15 +9216,15 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) |
|
|
|
if (rc) |
|
|
|
if (rc) |
|
|
|
goto leave; |
|
|
|
goto leave; |
|
|
|
|
|
|
|
|
|
|
|
w2 = txn->mt_next_pgno * env->me_psize; |
|
|
|
w3 = txn->mt_next_pgno * env->me_psize; |
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t fsize = 0; |
|
|
|
size_t fsize = 0; |
|
|
|
if ((rc = mdb_fsize(env->me_fd, &fsize))) |
|
|
|
if ((rc = mdb_fsize(env->me_fd, &fsize))) |
|
|
|
goto leave; |
|
|
|
goto leave; |
|
|
|
if (w2 > fsize) |
|
|
|
if (w3 > fsize) |
|
|
|
w2 = fsize; |
|
|
|
w3 = fsize; |
|
|
|
} |
|
|
|
} |
|
|
|
wsize = w2 - wsize; |
|
|
|
wsize = w3 - wsize; |
|
|
|
while (wsize > 0) { |
|
|
|
while (wsize > 0) { |
|
|
|
if (wsize > MAX_WRITE) |
|
|
|
if (wsize > MAX_WRITE) |
|
|
|
w2 = MAX_WRITE; |
|
|
|
w2 = MAX_WRITE; |
|
|
|