[llvm-commits] [llvm] r153435 - /llvm/trunk/lib/Support/Unix/Path.inc
Anton Korobeynikov
asl at math.spbu.ru
Mon Mar 26 05:05:51 PDT 2012
Author: asl
Date: Mon Mar 26 07:05:51 2012
New Revision: 153435
URL: http://llvm.org/viewvc/llvm-project?rev=153435&view=rev
Log:
Fix GetMainExecutable on kFreeBSD.
Patch by Sylvestre Ledru!
Modified:
llvm/trunk/lib/Support/Unix/Path.inc
Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=153435&r1=153434&r2=153435&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Mon Mar 26 07:05:51 2012
@@ -256,7 +256,7 @@
}
#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)
@@ -308,7 +308,7 @@
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.
@@ -325,7 +325,7 @@
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)
More information about the llvm-commits
mailing list