Index: third_party/protobuf/src/google/protobuf/testing/file.cc |
diff --git a/third_party/protobuf/src/google/protobuf/testing/file.cc b/third_party/protobuf/src/google/protobuf/testing/file.cc |
index 470512edff2c041364b0de90b52d76f1f5729e42..3d07b1276cf96698f95b367d65999de5e6eb2362 100644 |
--- a/third_party/protobuf/src/google/protobuf/testing/file.cc |
+++ b/third_party/protobuf/src/google/protobuf/testing/file.cc |
@@ -91,7 +91,6 @@ bool File::WriteStringToFile(const string& contents, const string& name) { |
if (fwrite(contents.data(), 1, contents.size(), file) != contents.size()) { |
GOOGLE_LOG(ERROR) << "fwrite(" << name << "): " << strerror(errno); |
- fclose(file); |
return false; |
} |
@@ -141,12 +140,12 @@ void File::DeleteRecursively(const string& name, |
#ifdef _MSC_VER |
// This interface is so weird. |
- WIN32_FIND_DATAA find_data; |
- HANDLE find_handle = FindFirstFileA((name + "/*").c_str(), &find_data); |
+ WIN32_FIND_DATA find_data; |
+ HANDLE find_handle = FindFirstFile((name + "/*").c_str(), &find_data); |
if (find_handle == INVALID_HANDLE_VALUE) { |
// Just delete it, whatever it is. |
- DeleteFileA(name.c_str()); |
- RemoveDirectoryA(name.c_str()); |
+ DeleteFile(name.c_str()); |
+ RemoveDirectory(name.c_str()); |
return; |
} |
@@ -156,15 +155,15 @@ void File::DeleteRecursively(const string& name, |
string path = name + "/" + entry_name; |
if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { |
DeleteRecursively(path, NULL, NULL); |
- RemoveDirectoryA(path.c_str()); |
+ RemoveDirectory(path.c_str()); |
} else { |
- DeleteFileA(path.c_str()); |
+ DeleteFile(path.c_str()); |
} |
} |
- } while(FindNextFileA(find_handle, &find_data)); |
+ } while(FindNextFile(find_handle, &find_data)); |
FindClose(find_handle); |
- RemoveDirectoryA(name.c_str()); |
+ RemoveDirectory(name.c_str()); |
#else |
// Use opendir()! Yay! |
// lstat = Don't follow symbolic links. |