From cb4b5a8aa228116f03d76ace440115516cfb0ed5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 29 Jan 2019 22:25:37 +0300 Subject: fixes #1802 (Dbx_Mdbx doesn't change profile timestamp on exit) --- plugins/Dbx_mdbx/src/dbintf.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/Dbx_mdbx/src') diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index 9c725297cd..40b899d1e2 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -64,8 +64,6 @@ CDbxMDBX::~CDbxMDBX() int CDbxMDBX::Load() { - TouchFile(); - unsigned int defFlags = MDBX_CREATE; { txn_ptr trnlck(StartTran()); @@ -267,13 +265,13 @@ int CDbxMDBX::Map() void CDbxMDBX::TouchFile() { SYSTEMTIME st; - ::GetLocalTime(&st); + ::GetSystemTime(&st); FILETIME ft; SystemTimeToFileTime(&st, &ft); - HANDLE hFile = CreateFileW(m_tszProfileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); - if (hFile) { + HANDLE hFile = CreateFileW(m_tszProfileName, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); + if (hFile != INVALID_HANDLE_VALUE) { SetFileTime(hFile, nullptr, &ft, &ft); CloseHandle(hFile); } -- cgit v1.2.3