From e78331a9633a7ed466ae2d0bd2c29828eb112eae Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Thu, 29 Sep 2016 03:44:05 +0000 Subject: devel/android-tools-{adb,fastboot}-devel: update to n.p.5.3582 Changes: https://android.googlesource.com/platform/system/core/+log/2f21b7cecda2..dfd30c4a169e/adb Changes: https://android.googlesource.com/platform/system/core/+log/2f21b7cecda2..dfd30c4a169e/fastboot --- .../files/patch-base_file.cpp | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 devel/android-tools-adb-devel/files/patch-base_file.cpp (limited to 'devel/android-tools-adb-devel/files/patch-base_file.cpp') diff --git a/devel/android-tools-adb-devel/files/patch-base_file.cpp b/devel/android-tools-adb-devel/files/patch-base_file.cpp new file mode 100644 index 000000000000..199da0b95aca --- /dev/null +++ b/devel/android-tools-adb-devel/files/patch-base_file.cpp @@ -0,0 +1,40 @@ +--- base/file.cpp.orig 2016-09-28 18:07:09 UTC ++++ base/file.cpp +@@ -18,6 +18,9 @@ + + #include + #include ++#include // PATH_MAX ++#include // BUFSIZ ++#include // strerror + #include + #include + #include +@@ -34,6 +37,9 @@ + #if defined(__APPLE__) + #include + #endif ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include ++#endif + #if defined(_WIN32) + #include + #endif +@@ -231,6 +237,17 @@ std::string GetExecutablePath() { + if (result == 0 || result == sizeof(path) - 1) return ""; + path[PATH_MAX - 1] = 0; + return path; ++#elif defined(KERN_PROC_PATHNAME) ++ char path[PATH_MAX + 1]; ++ size_t path_len = sizeof(path); ++ int mib[] = { ++ CTL_KERN, ++ KERN_PROC, ++ KERN_PROC_PATHNAME, ++ getpid() ++ }; ++ int rc = sysctl(mib, arraysize(mib), path, &path_len, NULL, 0); ++ return rc ? "" : path; + #else + #error unknown OS + #endif -- cgit v1.2.3