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

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

Issue 2581363002: Fuchsia: resolve executable name, fetch environment vars (Closed)
Patch Set: Cleanup Created 4 years 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_fuchsia.cc » ('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(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 return target_name; 346 return target_name;
347 } 347 }
348 348
349 349
350 bool File::IsAbsolutePath(const char* pathname) { 350 bool File::IsAbsolutePath(const char* pathname) {
351 return ((pathname != NULL) && (pathname[0] == '/')); 351 return ((pathname != NULL) && (pathname[0] == '/'));
352 } 352 }
353 353
354 354
355 const char* File::GetCanonicalPath(const char* pathname) { 355 const char* File::GetCanonicalPath(const char* pathname) {
356 // TODO(MG-425): realpath() is not implemented.
357 #if 0
356 char* abs_path = NULL; 358 char* abs_path = NULL;
357 if (pathname != NULL) { 359 if (pathname != NULL) {
358 char* resolved_path = DartUtils::ScopedCString(PATH_MAX + 1); 360 char* resolved_path = DartUtils::ScopedCString(PATH_MAX + 1);
359 ASSERT(resolved_path != NULL); 361 ASSERT(resolved_path != NULL);
360 do { 362 do {
361 abs_path = realpath(pathname, resolved_path); 363 abs_path = realpath(pathname, resolved_path);
362 } while ((abs_path == NULL) && (errno == EINTR)); 364 } while ((abs_path == NULL) && (errno == EINTR));
363 ASSERT((abs_path == NULL) || IsAbsolutePath(abs_path)); 365 ASSERT((abs_path == NULL) || IsAbsolutePath(abs_path));
364 ASSERT((abs_path == NULL) || (abs_path == resolved_path)); 366 ASSERT((abs_path == NULL) || (abs_path == resolved_path));
365 } 367 }
366 return abs_path; 368 return abs_path;
369 #else
370 return pathname;
371 #endif
367 } 372 }
368 373
369 374
370 const char* File::PathSeparator() { 375 const char* File::PathSeparator() {
371 return "/"; 376 return "/";
372 } 377 }
373 378
374 379
375 const char* File::StringEscapedPathSeparator() { 380 const char* File::StringEscapedPathSeparator() {
376 return "/"; 381 return "/";
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 return ((file_1_info.st_ino == file_2_info.st_ino) && 442 return ((file_1_info.st_ino == file_2_info.st_ino) &&
438 (file_1_info.st_dev == file_2_info.st_dev)) 443 (file_1_info.st_dev == file_2_info.st_dev))
439 ? File::kIdentical 444 ? File::kIdentical
440 : File::kDifferent; 445 : File::kDifferent;
441 } 446 }
442 447
443 } // namespace bin 448 } // namespace bin
444 } // namespace dart 449 } // namespace dart
445 450
446 #endif // defined(TARGET_OS_FUCHSIA) 451 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/platform_fuchsia.cc » ('j') | runtime/bin/platform_fuchsia.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698