Index: base/platform_file_posix.cc |
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc |
index 2ffac06456aac130f20622b0547319fec99bf3f1..64070f896d071df6150e540e4c23d95757acc133 100644 |
--- a/base/platform_file_posix.cc |
+++ b/base/platform_file_posix.cc |
@@ -44,6 +44,12 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, |
open_flags = O_CREAT | O_TRUNC; |
} |
+ if (flags & PLATFORM_FILE_TRUNCATE) { |
+ DCHECK(!open_flags); |
darin (slow to review)
2011/05/20 21:02:13
so this means that it is not possible to specify P
yzshen1
2011/05/20 21:29:24
I think PlatformFileFlags are probably designed to
|
+ DCHECK(flags & PLATFORM_FILE_WRITE); |
+ open_flags = O_TRUNC; |
+ } |
+ |
if (!open_flags && !(flags & PLATFORM_FILE_OPEN) && |
darin (slow to review)
2011/05/20 21:02:13
it looks like you might be breaking this check, wh
yzshen1
2011/05/20 21:29:24
This is what I have described in the CL descriptio
|
!(flags & PLATFORM_FILE_OPEN_ALWAYS)) { |
NOTREACHED(); |
@@ -62,11 +68,6 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, |
NOTREACHED(); |
} |
- if (flags & PLATFORM_FILE_TRUNCATE) { |
- DCHECK(flags & PLATFORM_FILE_WRITE); |
- open_flags |= O_TRUNC; |
- } |
- |
COMPILE_ASSERT(O_RDONLY == 0, O_RDONLY_must_equal_zero); |
int descriptor = |