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

Side by Side Diff: runtime/bin/file_linux.cc

Issue 2698813002: [dart:io][windows] Make unicode characters display correctly. (Closed)
Patch Set: Address comments Created 3 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/file_fuchsia.cc ('k') | runtime/bin/file_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR)); 125 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), 0, SEEK_CUR));
126 } 126 }
127 127
128 128
129 bool File::SetPosition(int64_t position) { 129 bool File::SetPosition(int64_t position) {
130 ASSERT(handle_->fd() >= 0); 130 ASSERT(handle_->fd() >= 0);
131 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0; 131 return NO_RETRY_EXPECTED(lseek64(handle_->fd(), position, SEEK_SET)) >= 0;
132 } 132 }
133 133
134 134
135 // There is no difference between binary and text translation modes on this
136 // platform, so this operation is a no-op.
137 void File::SetTranslation(DartFileTranslation translation) {}
138
139
135 bool File::Truncate(int64_t length) { 140 bool File::Truncate(int64_t length) {
136 ASSERT(handle_->fd() >= 0); 141 ASSERT(handle_->fd() >= 0);
137 return TEMP_FAILURE_RETRY(ftruncate64(handle_->fd(), length) != -1); 142 return TEMP_FAILURE_RETRY(ftruncate64(handle_->fd(), length) != -1);
138 } 143 }
139 144
140 145
141 bool File::Flush() { 146 bool File::Flush() {
142 ASSERT(handle_->fd() >= 0); 147 ASSERT(handle_->fd() >= 0);
143 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1; 148 return NO_RETRY_EXPECTED(fsync(handle_->fd())) != -1;
144 } 149 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 return ((file_1_info.st_ino == file_2_info.st_ino) && 594 return ((file_1_info.st_ino == file_2_info.st_ino) &&
590 (file_1_info.st_dev == file_2_info.st_dev)) 595 (file_1_info.st_dev == file_2_info.st_dev))
591 ? File::kIdentical 596 ? File::kIdentical
592 : File::kDifferent; 597 : File::kDifferent;
593 } 598 }
594 599
595 } // namespace bin 600 } // namespace bin
596 } // namespace dart 601 } // namespace dart
597 602
598 #endif // defined(TARGET_OS_LINUX) 603 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/file_fuchsia.cc ('k') | runtime/bin/file_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698