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

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

Issue 870523002: Fix mac build, missing ; (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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_MACOS) 6 #if defined(TARGET_OS_MACOS)
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // target. The link might have changed before the readlink call. 333 // target. The link might have changed before the readlink call.
334 const int kBufferSize = 1024; 334 const int kBufferSize = 1024;
335 char target[kBufferSize]; 335 char target[kBufferSize];
336 size_t target_size = TEMP_FAILURE_RETRY( 336 size_t target_size = TEMP_FAILURE_RETRY(
337 readlink(pathname, target, kBufferSize)); 337 readlink(pathname, target, kBufferSize));
338 if (target_size <= 0) { 338 if (target_size <= 0) {
339 return NULL; 339 return NULL;
340 } 340 }
341 char* target_name = reinterpret_cast<char*>(malloc(target_size + 1)); 341 char* target_name = reinterpret_cast<char*>(malloc(target_size + 1));
342 if (target_name == NULL) { 342 if (target_name == NULL) {
343 return NULL 343 return NULL;
344 } 344 }
345 memmove(target_name, target, target_size); 345 memmove(target_name, target, target_size);
346 target_name[target_size] = '\0'; 346 target_name[target_size] = '\0';
347 return target_name; 347 return target_name;
348 } 348 }
349 349
350 350
351 bool File::IsAbsolutePath(const char* pathname) { 351 bool File::IsAbsolutePath(const char* pathname) {
352 return (pathname != NULL && pathname[0] == '/'); 352 return (pathname != NULL && pathname[0] == '/');
353 } 353 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 return (file_1_info.st_ino == file_2_info.st_ino && 425 return (file_1_info.st_ino == file_2_info.st_ino &&
426 file_1_info.st_dev == file_2_info.st_dev) ? 426 file_1_info.st_dev == file_2_info.st_dev) ?
427 File::kIdentical : 427 File::kIdentical :
428 File::kDifferent; 428 File::kDifferent;
429 } 429 }
430 430
431 } // namespace bin 431 } // namespace bin
432 } // namespace dart 432 } // namespace dart
433 433
434 #endif // defined(TARGET_OS_MACOS) 434 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698