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

Unified Diff: base/platform_file_posix.cc

Issue 7038032: Fix PP_FileOpenFlags_Dev handling: (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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
« no previous file with comments | « no previous file | ppapi/tests/test_file_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « no previous file | ppapi/tests/test_file_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698