mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
Fix GetMainExecutable on kFreeBSD.
Patch by Sylvestre Ledru! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153435 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -256,7 +256,7 @@ Path::GetCurrentDirectory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined (__NetBSD__) || \
|
#if defined(__FreeBSD__) || defined (__NetBSD__) || \
|
||||||
defined(__OpenBSD__) || defined(__minix)
|
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
|
||||||
static int
|
static int
|
||||||
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
|
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
|
||||||
const char *dir, const char *bin)
|
const char *dir, const char *bin)
|
||||||
@ -308,7 +308,7 @@ getprogpath(char ret[PATH_MAX], const char *bin)
|
|||||||
free(pv);
|
free(pv);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
#endif // __FreeBSD__ || __NetBSD__
|
#endif // __FreeBSD__ || __NetBSD__ || __FreeBSD_kernel__
|
||||||
|
|
||||||
/// GetMainExecutable - Return the path to the main executable, given the
|
/// GetMainExecutable - Return the path to the main executable, given the
|
||||||
/// value of argv[0] from program startup.
|
/// value of argv[0] from program startup.
|
||||||
@ -325,7 +325,7 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
|
|||||||
return Path(link_path);
|
return Path(link_path);
|
||||||
}
|
}
|
||||||
#elif defined(__FreeBSD__) || defined (__NetBSD__) || \
|
#elif defined(__FreeBSD__) || defined (__NetBSD__) || \
|
||||||
defined(__OpenBSD__) || defined(__minix)
|
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
|
||||||
char exe_path[PATH_MAX];
|
char exe_path[PATH_MAX];
|
||||||
|
|
||||||
if (getprogpath(exe_path, argv0) != NULL)
|
if (getprogpath(exe_path, argv0) != NULL)
|
||||||
|
Reference in New Issue
Block a user