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

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

Issue 2941873002: [Fuchsia] Fix Platform.executable and Platform.resolvedExecutable (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | runtime/bin/platform.h » ('j') | runtime/bin/platform_fuchsia.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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(HOST_OS_FUCHSIA) 6 #if defined(HOST_OS_FUCHSIA)
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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 return target_name; 500 return target_name;
501 } 501 }
502 502
503 503
504 bool File::IsAbsolutePath(const char* pathname) { 504 bool File::IsAbsolutePath(const char* pathname) {
505 return ((pathname != NULL) && (pathname[0] == '/')); 505 return ((pathname != NULL) && (pathname[0] == '/'));
506 } 506 }
507 507
508 508
509 const char* File::GetCanonicalPath(const char* pathname) { 509 const char* File::GetCanonicalPath(const char* pathname) {
510 // TODO(MG-425): realpath() is not implemented.
511 #if 0
512 char* abs_path = NULL; 510 char* abs_path = NULL;
513 if (pathname != NULL) { 511 if (pathname != NULL) {
514 char* resolved_path = DartUtils::ScopedCString(PATH_MAX + 1); 512 char* resolved_path = DartUtils::ScopedCString(PATH_MAX + 1);
515 ASSERT(resolved_path != NULL); 513 ASSERT(resolved_path != NULL);
516 do { 514 abs_path = realpath(pathname, resolved_path);
517 abs_path = realpath(pathname, resolved_path);
518 } while ((abs_path == NULL) && (errno == EINTR));
519 ASSERT((abs_path == NULL) || IsAbsolutePath(abs_path)); 515 ASSERT((abs_path == NULL) || IsAbsolutePath(abs_path));
520 ASSERT((abs_path == NULL) || (abs_path == resolved_path)); 516 ASSERT((abs_path == NULL) || (abs_path == resolved_path));
521 } 517 }
522 return abs_path; 518 return abs_path;
523 #else
524 return pathname;
525 #endif
526 } 519 }
527 520
528 521
529 const char* File::PathSeparator() { 522 const char* File::PathSeparator() {
530 return "/"; 523 return "/";
531 } 524 }
532 525
533 526
534 const char* File::StringEscapedPathSeparator() { 527 const char* File::StringEscapedPathSeparator() {
535 return "/"; 528 return "/";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return ((file_1_info.st_ino == file_2_info.st_ino) && 562 return ((file_1_info.st_ino == file_2_info.st_ino) &&
570 (file_1_info.st_dev == file_2_info.st_dev)) 563 (file_1_info.st_dev == file_2_info.st_dev))
571 ? File::kIdentical 564 ? File::kIdentical
572 : File::kDifferent; 565 : File::kDifferent;
573 } 566 }
574 567
575 } // namespace bin 568 } // namespace bin
576 } // namespace dart 569 } // namespace dart
577 570
578 #endif // defined(HOST_OS_FUCHSIA) 571 #endif // defined(HOST_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/platform.h » ('j') | runtime/bin/platform_fuchsia.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698