summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc
index 080883e..a2a0f27 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -350,7 +350,8 @@ int ReadFile(const string& path, string* contents, string* err) {
if (!::ReadFile(f, buf, sizeof(buf), &len, NULL)) {
err->assign(GetLastErrorString());
contents->clear();
- return -1;
+ ::CloseHandle(f);
+ return -EIO;
}
if (len == 0)
break;