mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-30 19:55:11 +00:00
Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
058c251d4a
commit
7b3544ba97
@ -344,10 +344,8 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
|
||||
#elif defined(__linux__) || defined(__CYGWIN__)
|
||||
char exe_path[MAXPATHLEN];
|
||||
ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path));
|
||||
if (len > 0 && len < MAXPATHLEN - 1) {
|
||||
exe_path[len] = '\0';
|
||||
return Path(std::string(exe_path));
|
||||
}
|
||||
if (len >= 0)
|
||||
return Path(std::string(exe_path, len));
|
||||
#elif defined(HAVE_DLFCN_H)
|
||||
// Use dladdr to get executable path if available.
|
||||
Dl_info DLInfo;
|
||||
|
Loading…
Reference in New Issue
Block a user