From 023eb917a80874322b88453d914f35fb46a5797e Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 15 Sep 2022 15:29:22 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#26090: fs: fully initialize `_OVERLAPPED` for win32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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::’ [-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 --- src/fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs.cpp b/src/fs.cpp index e63844db6f..27fd9b5db4 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -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::max(), std::numeric_limits::max(), &overlapped)) { reason = GetErrorReason(); return false;