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

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

Issue 22381002: Fixes to get Dart VM compiling on Ubuntu 13.04, Debian Wheezy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Alternative type-punning fix Created 7 years, 4 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 | Annotate | Revision Log
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 29 matching lines...) Expand all
40 Close(); 40 Close();
41 } 41 }
42 delete handle_; 42 delete handle_;
43 } 43 }
44 44
45 45
46 void File::Close() { 46 void File::Close() {
47 ASSERT(handle_->fd() >= 0); 47 ASSERT(handle_->fd() >= 0);
48 int err = TEMP_FAILURE_RETRY(close(handle_->fd())); 48 int err = TEMP_FAILURE_RETRY(close(handle_->fd()));
49 if (err != 0) { 49 if (err != 0) {
50 const int kBufferSize = 1024; 50 Log::PrintErr("%s\n", strerror(errno));
Ivan Posva 2013/08/07 18:33:44 strerror is not multithread safe and you should be
51 char error_message[kBufferSize];
52 strerror_r(errno, error_message, kBufferSize);
53 Log::PrintErr("%s\n", error_message);
54 } 51 }
55 handle_->set_fd(kClosedFd); 52 handle_->set_fd(kClosedFd);
56 } 53 }
57 54
58 55
59 bool File::IsClosed() { 56 bool File::IsClosed() {
60 return handle_->fd() == kClosedFd; 57 return handle_->fd() == kClosedFd;
61 } 58 }
62 59
63 60
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return (file_1_info.st_ino == file_2_info.st_ino && 344 return (file_1_info.st_ino == file_2_info.st_ino &&
348 file_1_info.st_dev == file_2_info.st_dev) ? 345 file_1_info.st_dev == file_2_info.st_dev) ?
349 File::kIdentical : 346 File::kIdentical :
350 File::kDifferent; 347 File::kDifferent;
351 } 348 }
352 349
353 } // namespace bin 350 } // namespace bin
354 } // namespace dart 351 } // namespace dart
355 352
356 #endif // defined(TARGET_OS_LINUX) 353 #endif // defined(TARGET_OS_LINUX)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698