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

Unified Diff: runtime/bin/platform_macos.cc

Issue 1160793004: Resolve the executable path on Mac OS when sym-linked (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_macos.cc
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index 702bf017806e811b78243ca729276b7c8cdc8872..351a829db717d47f0f0159d62b39fc06ddba3635 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -7,6 +7,7 @@
#include <mach-o/dyld.h>
+#include "bin/file.h"
#include "bin/platform.h"
#include <crt_externs.h> // NOLINT
@@ -91,7 +92,10 @@ char* Platform::ResolveExecutablePath() {
free(path);
return NULL;
}
- return path;
+ // Return the canonical path as the returned path might contain symlinks.
+ char* canon_path = File::GetCanonicalPath(path);
+ free(path);
+ return canon_path;
}
} // namespace bin
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698