From c74d56809abfadb057139cb2410f74bc8ec4d09c Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Wed, 28 Sep 2016 12:32:45 -0700 Subject: adb: add libusb implementation for Linux/Darwin. Add a libusb-based implementation alongside the existing native implementations, controlled by the ADB_LIBUSB environment variable. Windows will need more work for the usb driver. Bug: http://b/31321337 Test: python test_device.py on linux/darwin, with ADB_LIBUSB=0 and 1 Change-Id: Ib68fb2c6c05475eae3ff4cc19f55802a6f489bb7 --- client/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client/main.cpp') diff --git a/client/main.cpp b/client/main.cpp index d583516..97a54fd 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "adb.h" @@ -86,7 +87,7 @@ static void setup_daemon_logging(void) { static BOOL WINAPI ctrlc_handler(DWORD type) { // TODO: Consider trying to kill a starting up adb server (if we're in // launch_server) by calling GenerateConsoleCtrlEvent(). - exit(STATUS_CONTROL_C_EXIT); + android::base::quick_exit(STATUS_CONTROL_C_EXIT); return TRUE; } #endif @@ -108,6 +109,10 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply } SetConsoleCtrlHandler(ctrlc_handler, TRUE); +#else + signal(SIGINT, [](int) { + android::base::quick_exit(0); + }); #endif init_transport_registration(); -- cgit v1.2.3