summaryrefslogtreecommitdiffstats
path: root/base/platform_file_win.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 23:33:34 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 23:33:34 +0000
commitca8e74e0be01f4766da829ccd1381ce0daa48718 (patch)
treec22edc100d96368c3e17e38133a5f7202be20177 /base/platform_file_win.cc
parentcc687ec560fb4889c42d331784d4a3f805427b55 (diff)
downloadchromium_src-ca8e74e0be01f4766da829ccd1381ce0daa48718.zip
chromium_src-ca8e74e0be01f4766da829ccd1381ce0daa48718.tar.gz
chromium_src-ca8e74e0be01f4766da829ccd1381ce0daa48718.tar.bz2
Linux: apply a different hyphen patch.
This will make it possible to use system hyphen. BUG=176285 Review URL: https://codereview.chromium.org/12259025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/platform_file_win.cc')
-rw-r--r--base/platform_file_win.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index b88fe9c..8c98183 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/files/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);