From a9eecd7f9a557b8d1e5844ca2f60583d853fef77 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Wed, 20 Dec 2023 20:47:57 +0100 Subject: [PATCH] fix: log last error code instead of a BOOL (#994) --- src/logging_unittest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc index ddd434f12..21232f685 100644 --- a/src/logging_unittest.cc +++ b/src/logging_unittest.cc @@ -724,8 +724,9 @@ static void GetFiles(const string& pattern, vector* files) { do { files->push_back(dirname + data.cFileName); } while (FindNextFileA(handle, &data)); - BOOL result = FindClose(handle); - LOG_SYSRESULT(result != 0); + if (!FindClose(handle)) { + LOG_SYSRESULT(GetLastError()); + } #else # error There is no way to do glob. #endif