diff options
author | Josh Gao <jmgao@google.com> | 2016-09-28 12:32:45 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-01-25 13:52:53 -0800 |
commit | c74d56809abfadb057139cb2410f74bc8ec4d09c (patch) | |
tree | 43d1639db44696dd41cf6c1b70c709f5054e6ac9 /client/main.cpp | |
parent | f83d9c38016439d6288622ec53b020e6ca16efce (diff) | |
download | adb-c74d56809abfadb057139cb2410f74bc8ec4d09c.tar.gz |
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
Diffstat (limited to 'client/main.cpp')
-rw-r--r-- | client/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 <android-base/errors.h> #include <android-base/file.h> #include <android-base/logging.h> +#include <android-base/quick_exit.h> #include <android-base/stringprintf.h> #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(); |