Revert "Split adb_main.cpp into client and daemon."
This reverts commit cf07494ac2a101c3afbe23a7d85121553f586cf7.
diff --git a/adb/usb_osx.cpp b/adb/usb_osx.cpp
index af65130..0d0b3ad 100644
--- a/adb/usb_osx.cpp
+++ b/adb/usb_osx.cpp
@@ -401,18 +401,11 @@
return NULL;
}
-static void usb_cleanup() {
- DBG("usb_cleanup\n");
- close_usb_devices();
- if (currentRunLoop)
- CFRunLoopStop(currentRunLoop);
-}
+static int initialized = 0;
void usb_init() {
- static bool initialized = false;
- if (!initialized) {
- atexit(usb_cleanup);
-
+ if (!initialized)
+ {
adb_mutex_init(&start_lock, NULL);
adb_cond_init(&start_cond, NULL);
@@ -428,10 +421,18 @@
adb_mutex_destroy(&start_lock);
adb_cond_destroy(&start_cond);
- initialized = true;
+ initialized = 1;
}
}
+void usb_cleanup()
+{
+ DBG("usb_cleanup\n");
+ close_usb_devices();
+ if (currentRunLoop)
+ CFRunLoopStop(currentRunLoop);
+}
+
int usb_write(usb_handle *handle, const void *buf, int len)
{
IOReturn result;