Date: Tue, 3 Sep 2013 09:49:17 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r326130 - in head/devel/android-tools-adb: . files Message-ID: <201309030949.r839nH8S002927@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Tue Sep 3 09:49:17 2013 New Revision: 326130 URL: http://svnweb.freebsd.org/changeset/ports/326130 Log: Get rid of /proc dependency. PR: ports/181659 Submitted by: Jan Beich <jbeich at tormail dot org> Added: head/devel/android-tools-adb/files/patch-get_my_path_freebsd.c (contents, props changed) Modified: head/devel/android-tools-adb/Makefile Modified: head/devel/android-tools-adb/Makefile ============================================================================== --- head/devel/android-tools-adb/Makefile Tue Sep 3 08:49:46 2013 (r326129) +++ head/devel/android-tools-adb/Makefile Tue Sep 3 09:49:17 2013 (r326130) @@ -2,6 +2,7 @@ PORTNAME= android-tools-adb PORTVERSION= 4.3 +PORTREVISION= 1 CATEGORIES= devel DISTNAME= android-platform_system_core-${GH_COMMIT} Added: head/devel/android-tools-adb/files/patch-get_my_path_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/android-tools-adb/files/patch-get_my_path_freebsd.c Tue Sep 3 09:49:17 2013 (r326130) @@ -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); + } +-
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309030949.r839nH8S002927>