improve support for OpenBSD, patch by Amit Kulkarni!

llvm-svn: 125943
This commit is contained in:
Chris Lattner 2011-02-18 17:04:56 +00:00
parent 7c0cb2bbf5
commit c37910ea28
1 changed files with 4 additions and 2 deletions

View File

@ -260,7 +260,8 @@ Path::GetCurrentDirectory() {
return Path(pathname);
}
#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__minix)
#if defined(__FreeBSD__) || defined (__NetBSD__) || \
defined(__OpenBSD__) || defined(__minix)
static int
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
const char *dir, const char *bin)
@ -328,7 +329,8 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
if (realpath(exe_path, link_path))
return Path(link_path);
}
#elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__minix)
#elif defined(__FreeBSD__) || defined (__NetBSD__) || \
defined(__OpenBSD__) || defined(__minix)
char exe_path[PATH_MAX];
if (getprogpath(exe_path, argv0) != NULL)