svn commit: r503390 - head/devel/android-tools-adb/files

Jan Beich jbeich at FreeBSD.org
Mon Jun 3 13:53:12 UTC 2019


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 <android-base/file.h>
  #include <android-base/logging.h>
-@@ -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<std::string, std::unique_ptr<usb_handle>>();
  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<int> 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>(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<std::mutex> 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
 +    {


More information about the svn-ports-all mailing list