Bug 181659 - [patch] devel/android-tools-adb: get rid of /proc dependency
Summary: [patch] devel/android-tools-adb: get rid of /proc dependency
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kevin Lo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-29 19:40 UTC by Jan Beich
Modified: 2013-09-03 10:56 UTC (History)
0 users

See Also:


Attachments
no_procfs.diff (599 bytes, patch)
2013-08-29 19:40 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2013-08-29 19:40:00 UTC

How-To-Repeat: $ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
ADB server didn't ACK
* failed to start daemon *
Exit 255
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-08-29 19:40:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kevlo

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-09-03 10:49:25 UTC
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);
+ }
+-
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Kevin Lo freebsd_committer freebsd_triage 2013-09-03 10:56:18 UTC
State Changed
From-To: open->closed

Committed, thanks.