diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
commit | a56e30c8d33048216567753d9d3fefc2152af8ac (patch) | |
tree | 7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/coreclr/hosts/unixcoreruncommon | |
parent | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff) | |
download | coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2 coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip |
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/coreclr/hosts/unixcoreruncommon')
-rw-r--r-- | src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp b/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp index 5ac7654780..d40fb424e6 100644 --- a/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp +++ b/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp @@ -49,21 +49,7 @@ bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutable) // Get path to the executable for the current process using // platform specific means. -#if defined(__linux__) || (defined(__NetBSD__) && !defined(KERN_PROC_PATHNAME)) - // On Linux, fetch the entry point EXE absolute path, inclusive of filename. - char exe[PATH_MAX]; - ssize_t res = readlink(symlinkEntrypointExecutable, exe, PATH_MAX - 1); - if (res != -1) - { - exe[res] = '\0'; - entrypointExecutable.assign(exe); - result = true; - } - else - { - result = false; - } -#elif defined(__APPLE__) +#if defined(__APPLE__) // On Mac, we ask the OS for the absolute path to the entrypoint executable uint32_t lenActualPath = 0; @@ -115,10 +101,9 @@ bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutable) result = false; } #else - // On non-Mac OS, return the symlink that will be resolved by GetAbsolutePath + // On other OSs, return the symlink that will be resolved by GetAbsolutePath // to fetch the entrypoint EXE absolute path, inclusive of filename. - entrypointExecutable.assign(symlinkEntrypointExecutable); - result = true; + result = GetAbsolutePath(symlinkEntrypointExecutable, entrypointExecutable); #endif return result; |