From f366b3698b409405e1ee88476d1186f29fe14b06 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Fri, 16 Mar 2012 14:50:07 -0700 Subject: adb: Don't synchronize with transport using sleep Services that cause adbd to reboot are currently implemented this way: write(fd, response) close(fd) sleep(1) exit(1) sleep(1) is necessary to leave time for the transport to transmit the response before the daemon exits. This is slow and unreliable. Instead, add a flag to the asocket to make it exit the daemon only after the socket is closed. Change-Id: I9df45ea6221f0d9b828703b9b2316a5d4fe59352 --- adb/adb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'adb/adb.h') diff --git a/adb/adb.h b/adb/adb.h index 85922bf8..03a7393a 100644 --- a/adb/adb.h +++ b/adb/adb.h @@ -86,6 +86,11 @@ struct asocket { */ int closing; + /* flag: quit adbd when both ends close the + ** local service socket + */ + int exit_on_close; + /* the asocket we are connected to */ -- cgit v1.2.3