mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:04:13 +08:00
mdbx-windows: удаление ненужного вызова LockFileEx()
внутри mdbx_env_copy()
.
This commit is contained in:
parent
686c908a95
commit
5a45c4a210
10
src/core.c
10
src/core.c
@ -20532,14 +20532,10 @@ LIBMDBX_API int mdbx_env_copyW(MDBX_env *env, const wchar_t *dest_path,
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (rc == MDBX_SUCCESS) {
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
OVERLAPPED ov;
|
/* no locking required since the file opened with ShareMode == 0 */
|
||||||
memset(&ov, 0, sizeof(ov));
|
|
||||||
if (!LockFileEx(newfd, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY,
|
|
||||||
0, 0, INT32_MAX, &ov))
|
|
||||||
rc = GetLastError();
|
|
||||||
#else
|
#else
|
||||||
|
if (rc == MDBX_SUCCESS) {
|
||||||
struct flock lock_op;
|
struct flock lock_op;
|
||||||
memset(&lock_op, 0, sizeof(lock_op));
|
memset(&lock_op, 0, sizeof(lock_op));
|
||||||
lock_op.l_type = F_WRLCK;
|
lock_op.l_type = F_WRLCK;
|
||||||
@ -20554,8 +20550,8 @@ LIBMDBX_API int mdbx_env_copyW(MDBX_env *env, const wchar_t *dest_path,
|
|||||||
#endif /* Linux */
|
#endif /* Linux */
|
||||||
)
|
)
|
||||||
rc = errno;
|
rc = errno;
|
||||||
#endif /* Windows / POSIX */
|
|
||||||
}
|
}
|
||||||
|
#endif /* Windows / POSIX */
|
||||||
|
|
||||||
if (rc == MDBX_SUCCESS)
|
if (rc == MDBX_SUCCESS)
|
||||||
rc = mdbx_env_copy2fd(env, newfd, flags);
|
rc = mdbx_env_copy2fd(env, newfd, flags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user