Merge bitcoin/bitcoin#26090: fs: fully initialize _OVERLAPPED for win32

02c9e564687af6ae2b0b6589108d502963f879cb fs: fully initialize _OVERLAPPED for win32 (Cory Fields)

Pull request description:

  ```bash
  fs.cpp: In member function ‘bool fsbridge::FileLock::TryLock()’:
  fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::InternalHigh’ [-Werror=missing-field-initializers]
    129 |     _OVERLAPPED overlapped = {0};
        |                                ^
  fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::<anonymous>’ [-Werror=missing-field-initializers]
  fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::hEvent’ [-Werror=missing-field-initializers]
  ```

  Came up in #25972. That PR is now rebased on this change.

  Closes: #26006

ACKs for top commit:
  sipsorcery:
    tACK 02c9e564687af6ae2b0b6589108d502963f879cb.
  hebasto:
    ACK 02c9e564687af6ae2b0b6589108d502963f879cb, tested on Linux x86_64:

Tree-SHA512: 6a0495c34bd952b2bb8c994a1450da7d3eee61225bb4ff0ce009c013f5e29dba94bb1c3ecef9989dc18c939909fdc8eba690a38f96da431ae9d64c23656de7d0
This commit is contained in:
fanquake 2022-09-15 15:29:22 +01:00 committed by pasta
parent 8de9065a24
commit 023eb917a8
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -126,7 +126,7 @@ bool FileLock::TryLock()
if (hFile == INVALID_HANDLE_VALUE) {
return false;
}
_OVERLAPPED overlapped = {0};
_OVERLAPPED overlapped = {};
if (!LockFileEx(hFile, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, std::numeric_limits<DWORD>::max(), std::numeric_limits<DWORD>::max(), &overlapped)) {
reason = GetErrorReason();
return false;