Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3026)

Unified Diff: base/platform_file_win.cc

Issue 12259025: Linux: apply a different hyphen patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/platform_file_win.cc
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index 7c72f9e92e1451d5873e854e9e818c298533078b..a68272e87503fd005f655b90e9e5f153d77fb5ae 100644
--- a/base/platform_file_win.cc
+++ b/base/platform_file_win.cc
@@ -4,6 +4,8 @@
#include "base/platform_file.h"
+#include <io.h>
+
#include "base/file_path.h"
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
@@ -109,6 +111,15 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
return file;
}
+FILE* FdopenPlatformFile(PlatformFile file, const char* mode) {
+ if (file == kInvalidPlatformFileValue)
+ return NULL;
+ int fd = _open_osfhandle(reinterpret_cast<intptr_t>(file), 0);
+ if (fd < 0)
+ return NULL;
+ return _fdopen(fd, mode);
+}
+
bool ClosePlatformFile(PlatformFile file) {
base::ThreadRestrictions::AssertIOAllowed();
return (CloseHandle(file) != 0);

Powered by Google App Engine
This is Rietveld 408576698