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

Unified Diff: runtime/bin/file_linux.cc

Issue 9346015: Change file opening operation to set position at the end of the file when FileMode.APPEND is used. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | « runtime/bin/file_impl.dart ('k') | runtime/bin/file_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_linux.cc
===================================================================
--- runtime/bin/file_linux.cc (revision 3943)
+++ runtime/bin/file_linux.cc (working copy)
@@ -116,6 +116,12 @@
if (fd < 0) {
return NULL;
}
+ if (((mode & kWrite) != 0) && ((mode & kTruncate) == 0)) {
+ int position = TEMP_FAILURE_RETRY(lseek(fd, 0, SEEK_END));
+ if (position < 0) {
+ return NULL;
+ }
+ }
return new File(name, new FileHandle(fd));
}
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | runtime/bin/file_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698