Speculative fix of Windows build breakage
Breakage: https://ci.chromium.org/ui/p/chromium/builders/try/win_chromium_compile_dbg_ng/1043793/overview
Change-Id: Idf5d535b2d50e2ac6499b57c7f466bd9256816eb
diff --git a/src/base/file_utils.cc b/src/base/file_utils.cc
index 8f998dd..91a5fc4 100644
--- a/src/base/file_utils.cc
+++ b/src/base/file_utils.cc
@@ -238,7 +238,9 @@
return base::ErrStatus("Directory path %s is too long", dir_path.c_str());
WIN32_FIND_DATAA ffd;
- base::ScopedResource<HANDLE, FindClose, nullptr, false,
+ // Wrap FindClose to: (1) make the return unix-style; (2) deal w/ stdcall.
+ static auto find_close = [](HANDLE h) { return FindClose(h) ? 0 : -1; };
+ base::ScopedResource<HANDLE, find_close, nullptr, false,
base::PlatformHandleChecker>
hFind(FindFirstFileA(glob_path.c_str(), &ffd));
if (!hFind) {