diff options
author | kevlo <kevlo@FreeBSD.org> | 2013-09-03 17:49:17 +0800 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2013-09-03 17:49:17 +0800 |
commit | a52a2e7a5c3b5eefe62bd3bf2e32eada8cadc0ce (patch) | |
tree | 3a797d9bbccb1156225399da9d0c504f85eae5b8 /devel | |
parent | a3c425eac4f10c609b832fbf89e050e1dcc2744f (diff) | |
download | freebsd-ports-gnome-a52a2e7a5c3b5eefe62bd3bf2e32eada8cadc0ce.tar.gz freebsd-ports-gnome-a52a2e7a5c3b5eefe62bd3bf2e32eada8cadc0ce.tar.zst freebsd-ports-gnome-a52a2e7a5c3b5eefe62bd3bf2e32eada8cadc0ce.zip |
Get rid of /proc dependency.
PR: ports/181659
Submitted by: Jan Beich <jbeich at tormail dot org>
Diffstat (limited to 'devel')
-rw-r--r-- | devel/android-tools-adb/Makefile | 1 | ||||
-rw-r--r-- | devel/android-tools-adb/files/patch-get_my_path_freebsd.c | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/devel/android-tools-adb/Makefile b/devel/android-tools-adb/Makefile index 9e0d315e0dc9..d50400f3833c 100644 --- a/devel/android-tools-adb/Makefile +++ b/devel/android-tools-adb/Makefile @@ -2,6 +2,7 @@ PORTNAME= android-tools-adb PORTVERSION= 4.3 +PORTREVISION= 1 CATEGORIES= devel DISTNAME= android-platform_system_core-${GH_COMMIT} diff --git a/devel/android-tools-adb/files/patch-get_my_path_freebsd.c b/devel/android-tools-adb/files/patch-get_my_path_freebsd.c new file mode 100644 index 000000000000..6a212df3f0ed --- /dev/null +++ b/devel/android-tools-adb/files/patch-get_my_path_freebsd.c @@ -0,0 +1,30 @@ +--- get_my_path_freebsd.c.orig 2013-09-03 17:33:27.000000000 +0800 ++++ get_my_path_freebsd.c 2013-09-03 17:41:13.000000000 +0800 +@@ -18,19 +18,18 @@ + */ + + #include <sys/types.h> ++#include <sys/sysctl.h> + #include <unistd.h> +-#include <limits.h> +-#include <stdio.h> + + void + get_my_path(char *exe, size_t maxLen) + { +- char proc[64]; ++ int mib[4] = { ++ CTL_KERN, ++ KERN_PROC, ++ KERN_PROC_PATHNAME, ++ getpid() ++ }; + +- snprintf(proc, sizeof(proc), "/proc/%d/file", getpid()); +- +- int err = readlink(proc, exe, maxLen - 1); +- +- exe[err > 0 ? err : 0] = '\0'; ++ sysctl(mib, 4, exe, &maxLen, NULL, 0); + } +- |