Chromium Code Reviews| 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)); |
| } |