Index: base/files/file_util.cc |
diff --git a/base/files/file_util.cc b/base/files/file_util.cc |
index 4b6b8886d8ad5d8bc0fd4855b10c97db52420d2e..44c42bf16a90e5f1b075f65ad75dc2f78224c1cd 100644 |
--- a/base/files/file_util.cc |
+++ b/base/files/file_util.cc |
@@ -4,9 +4,6 @@ |
#include "base/files/file_util.h" |
-#if defined(OS_WIN) |
-#include <io.h> |
-#endif |
#include <stdio.h> |
#include <fstream> |
@@ -198,12 +195,6 @@ bool TouchFile(const FilePath& path, |
const Time& last_modified) { |
int flags = File::FLAG_OPEN | File::FLAG_WRITE_ATTRIBUTES; |
-#if defined(OS_WIN) |
- // On Windows, FILE_FLAG_BACKUP_SEMANTICS is needed to open a directory. |
- if (DirectoryExists(path)) |
- flags |= File::FLAG_BACKUP_SEMANTICS; |
-#endif // OS_WIN |
- |
File file(path, flags); |
if (!file.IsValid()) |
return false; |
@@ -225,15 +216,9 @@ bool TruncateFile(FILE* file) { |
long current_offset = ftell(file); |
if (current_offset == -1) |
return false; |
-#if defined(OS_WIN) |
- int fd = _fileno(file); |
- if (_chsize(fd, current_offset) != 0) |
- return false; |
-#else |
int fd = fileno(file); |
if (ftruncate(fd, current_offset) != 0) |
return false; |
-#endif |
return true; |
} |