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

Unified Diff: base/files/file_posix.cc

Issue 314023002: Require FLAG_WRITE when FLAG_CREATE_ALWAYS is specified (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Require FLAG_WRITE on Windows too Created 6 years, 6 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 | base/files/file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_posix.cc
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index ad747d9582e2a4640ecf93a38c86b89beb7eaa2c..0764ee98660239ed813ada6d0dd0a7b15429aeee 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -183,6 +183,7 @@ void File::InitializeUnsafe(const FilePath& name, uint32 flags) {
if (flags & FLAG_CREATE_ALWAYS) {
DCHECK(!open_flags);
+ DCHECK(flags & FLAG_WRITE);
open_flags = O_CREAT | O_TRUNC;
}
« no previous file with comments | « no previous file | base/files/file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698