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

Unified Diff: base/platform_file_posix.cc

Issue 15861011: Add an "append flag" to base::PlatformFile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary braces Created 7 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 | « base/platform_file.h ('k') | base/platform_file_unittest.cc » ('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 beae804c629c86a6b8fa4ef716f601552d9a114e..b7c7396bf6e3607b34097dbb376dbdfc2c9d98cc 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -88,6 +88,11 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
if (flags & PLATFORM_FILE_TERMINAL_DEVICE)
open_flags |= O_NOCTTY | O_NDELAY;
+ if (flags & PLATFORM_FILE_APPEND && flags & PLATFORM_FILE_READ)
+ open_flags |= O_APPEND | O_RDWR;
+ else if (flags & PLATFORM_FILE_APPEND)
+ open_flags |= O_APPEND | O_WRONLY;
+
COMPILE_ASSERT(O_RDONLY == 0, O_RDONLY_must_equal_zero);
int mode = S_IRUSR | S_IWUSR;
« no previous file with comments | « base/platform_file.h ('k') | base/platform_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698