fix: log last error code instead of a BOOL (#994)

This commit is contained in:
Sergiu Deitsch 2023-12-20 20:47:57 +01:00 committed by GitHub
parent 7d973f9b4e
commit a9eecd7f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -724,8 +724,9 @@ static void GetFiles(const string& pattern, vector<string>* 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