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

Unified Diff: runtime/bin/file_macos.cc

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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_linux.cc ('k') | runtime/bin/file_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_macos.cc
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 7a976070ea53355598818b4dfc565de8fc4ee0c1..303824912f440458f240a27adb9927b8675e6e84 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -36,7 +36,7 @@ File::~File() {
void File::Close() {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
int err = close(handle_->fd());
if (err != 0) {
const int kBufferSize = 1024;
@@ -54,31 +54,31 @@ bool File::IsClosed() {
int64_t File::Read(void* buffer, int64_t num_bytes) {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
return read(handle_->fd(), buffer, num_bytes);
}
int64_t File::Write(const void* buffer, int64_t num_bytes) {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
return write(handle_->fd(), buffer, num_bytes);
}
off_t File::Position() {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
return lseek(handle_->fd(), 0, SEEK_CUR);
}
void File::Flush() {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
fsync(handle_->fd());
}
off_t File::Length() {
- assert(handle_->fd() >= 0);
+ ASSERT(handle_->fd() >= 0);
off_t position = lseek(handle_->fd(), 0, SEEK_CUR);
if (position < 0) {
// The file is not capable of seeking. Return an error.
« no previous file with comments | « runtime/bin/file_linux.cc ('k') | runtime/bin/file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698