Skip to content

Commit

Permalink
Fix GetMainExecutable on kFreeBSD.
Browse files Browse the repository at this point in the history
Patch by Sylvestre Ledru!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153435 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
asl committed Mar 26, 2012
1 parent d792a27 commit a3ad585
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Support/Unix/Path.inc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Path::GetCurrentDirectory() {
}

#if defined(__FreeBSD__) || defined (__NetBSD__) || \
defined(__OpenBSD__) || defined(__minix)
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
static int
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
const char *dir, const char *bin)
Expand Down Expand Up @@ -308,7 +308,7 @@ getprogpath(char ret[PATH_MAX], const char *bin)
free(pv);
return (NULL);
}
#endif // __FreeBSD__ || __NetBSD__
#endif // __FreeBSD__ || __NetBSD__ || __FreeBSD_kernel__

/// GetMainExecutable - Return the path to the main executable, given the
/// value of argv[0] from program startup.
Expand All @@ -325,7 +325,7 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
return Path(link_path);
}
#elif defined(__FreeBSD__) || defined (__NetBSD__) || \
defined(__OpenBSD__) || defined(__minix)
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__)
char exe_path[PATH_MAX];

if (getprogpath(exe_path, argv0) != NULL)
Expand Down

0 comments on commit a3ad585

Please sign in to comment.