win: Call _close before close file handle

Fix #4258.
This commit is contained in:
Cheng Zhao 2016-01-28 22:38:53 +08:00
parent 05aeceeb52
commit 516b01e398

View file

@ -130,14 +130,16 @@ Archive::Archive(const base::FilePath& path)
Archive::~Archive() { Archive::~Archive() {
#if defined(OS_WIN) #if defined(OS_WIN)
file_.Close(); if (fd_ != -1)
_close(fd_); _close(fd_);
#endif #endif
} }
bool Archive::Init() { bool Archive::Init() {
if (!file_.IsValid()) if (!file_.IsValid()) {
LOG(ERROR) << base::File::ErrorToString(file_.error_details());
return false; return false;
}
std::vector<char> buf; std::vector<char> buf;
int len; int len;