mirror of
https://git.freebsd.org/ports.git
synced 2025-06-08 06:10:30 -04:00
14 lines
482 B
C++
14 lines
482 B
C++
--- util/path.cpp.orig 2018-07-22 05:22:25 UTC
|
|
+++ util/path.cpp
|
|
@@ -82,7 +82,11 @@ std::string get_exe_location() {
|
|
char dest[PATH_MAX];
|
|
memset(dest, 0, PATH_MAX);
|
|
pid_t pid = getpid();
|
|
+#if defined(__FreeBSD__)
|
|
+ snprintf(path, PATH_MAX, "/proc/%d/file", pid);
|
|
+#else
|
|
snprintf(path, PATH_MAX, "/proc/%d/exe", pid);
|
|
+#endif
|
|
if (readlink(path, dest, PATH_MAX) == -1) {
|
|
throw exception("failed to locate Lean executable location");
|
|
} else {
|