Merge "Fix mac build for nativebridge tests." into lmp-dev
diff --git a/adb/adb_auth_client.c b/adb/adb_auth_client.c
index 8409c63..55e9dca 100644
--- a/adb/adb_auth_client.c
+++ b/adb/adb_auth_client.c
@@ -175,7 +175,7 @@
if (events & FDE_READ) {
ret = unix_read(fd, response, sizeof(response));
- if (ret < 0) {
+ if (ret <= 0) {
D("Framework disconnect\n");
if (usb_transport)
fdevent_remove(&usb_transport->auth_fde);
diff --git a/logd/LogReader.cpp b/logd/LogReader.cpp
index 8458c19..26df087 100644
--- a/logd/LogReader.cpp
+++ b/logd/LogReader.cpp
@@ -92,6 +92,11 @@
bool nonBlock = false;
if (strncmp(buffer, "dumpAndClose", 12) == 0) {
+ // Allow writer to get some cycles, and wait for pending notifications
+ sched_yield();
+ LogTimeEntry::lock();
+ LogTimeEntry::unlock();
+ sched_yield();
nonBlock = true;
}