From cb8e3f7adfaa48e09fb7a467086d69e4b6f948bd Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 27 Apr 2013 20:07:22 +0200 Subject: [PATCH] Checking whether closing succeeds --- util/env_win.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/env_win.cc b/util/env_win.cc index c64027f674f87..4730192bf8974 100644 --- a/util/env_win.cc +++ b/util/env_win.cc @@ -462,8 +462,8 @@ bool Win32MapFile::_UnmapCurrentRegion() // Defer syncing this data until next Sync() call, if any _pending_sync = true; } - UnmapViewOfFile(_base); - CloseHandle(_base_handle); + if (!UnmapViewOfFile(_base) || !CloseHandle(_base_handle)) + result = false; _file_offset += _limit - _base; _base = NULL; _base_handle = NULL;