From owner-svn-ports-all@freebsd.org Mon Jun 3 13:53:11 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB23B15B1BD4; Mon, 3 Jun 2019 13:53:11 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA2681542; Mon, 3 Jun 2019 13:53:11 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36F817166; Mon, 3 Jun 2019 13:53:11 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53DrBYi023934; Mon, 3 Jun 2019 13:53:11 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53DrBUY023933; Mon, 3 Jun 2019 13:53:11 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201906031353.x53DrBUY023933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Mon, 3 Jun 2019 13:53:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503390 - head/devel/android-tools-adb/files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: head/devel/android-tools-adb/files X-SVN-Commit-Revision: 503390 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5CA2681542 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 13:53:12 -0000 Author: jbeich Date: Mon Jun 3 13:53:10 2019 New Revision: 503390 URL: https://svnweb.freebsd.org/changeset/ports/503390 Log: devel/android-tools-adb: switch to LIBUSB_CAP_HAS_HOTPLUG whitelist $ adb connect 1.2.3.4 * daemon not running; starting now at tcp:5037 ADB server didn't ACK Full server startup log: /tmp/adb.1000.log Server had pid: 1193 --- adb starting (pid 1193) --- adb I 12-31 10:41:58 1193 1 main.cpp:56] Android Debug Bridge version 1.0.40 adb I 12-31 10:41:58 1193 1 main.cpp:56] Version 28.0.0-0 adb I 12-31 10:41:58 1193 1 main.cpp:56] Installed as /usr/pkg/bin/adb adb I 12-31 10:41:58 1193 1 main.cpp:56] adb F 12-31 10:41:58 1193 1 usb_libusb.cpp:517] failed to register libusb hotplug callback * failed to start daemon error: cannot connect to daemon Modified: head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp (contents, props changed) Modified: head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp ============================================================================== --- head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp Mon Jun 3 13:46:44 2019 (r503389) +++ head/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp Mon Jun 3 13:53:10 2019 (r503390) @@ -9,11 +9,13 @@ #include #include -@@ -39,6 +39,7 @@ +@@ -39,6 +39,9 @@ #include "adb.h" #include "adb_utils.h" ++#if !defined(__linux__) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__HAIKU__) +#include "sysdeps/chrono.h" ++#endif #include "transport.h" #include "usb.h" @@ -33,7 +35,7 @@ static auto& usb_handles = *new std::unordered_map>(); static auto& usb_handles_mutex = *new std::mutex(); -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) static libusb_hotplug_callback_handle hotplug_handle; +#else +static std::thread* device_poll_thread = nullptr; @@ -48,7 +50,7 @@ LOG(INFO) << "registered new usb device '" << device_serial << "'"; } -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) static std::atomic connecting_devices(0); static void device_connected(libusb_device* device) { @@ -88,7 +90,7 @@ LOG(FATAL) << "failed to initialize libusb: " << libusb_error_name(rc); } -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) // Register the hotplug callback. rc = libusb_hotplug_register_callback( nullptr, static_cast(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | @@ -105,14 +107,14 @@ } }).detach(); + -+#if !defined(LIBUSB_API_VERSION) || LIBUSB_API_VERSION < 0x01000102 ++#if !defined(__linux__) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__HAIKU__) + std::unique_lock lock(device_poll_mutex); + device_poll_thread = new std::thread(poll_for_devices); +#endif } void usb_cleanup() { -+#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 ++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__HAIKU__) libusb_hotplug_deregister_callback(nullptr, hotplug_handle); +#else + {