No description
Find a file
Spencer Low 2122c7a148 win32: adb start-server shows stdout/stderr output from actual server
When launching the adb server (typically from adb start-server),
redirect stdout/stderr to anonymous pipes which are read by threads in
the parent process, to make error diagnosis easier.

If there is an error during adb start-server, the output looks like:

> adb start-server
* daemon not running. starting it now on port 5037 *
error: could not blah                 # from server process
could not read ok from ADB Server     # from launch_server
* failed to start daemon *            # from adb_connect
error: cannot connect to daemon       # from adb_commandline

Fix handle-leaks in launch_server by using new unique_handle class
that is based on std::unique_ptr.

In the server, close stdin and redirect to adb.log *before* sending the
ACK, so that any errors are reported early instead of after the ACK.

Change-Id: I943881210a0ea9458fc36851339f916c3d6a0830
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-26 18:46:09 -07:00
adb win32: adb start-server shows stdout/stderr output from actual server 2015-08-26 18:46:09 -07:00
adf Adf: Remove unused variable 2015-07-27 22:08:16 -07:00
base Fix the Mac libbase build. 2015-08-13 20:09:29 -07:00
cpio makebootfs: use libcutils shared libraries 2015-04-15 10:32:19 -07:00
crash_reporter crash_reporter: Run with supplemental groups 2015-08-24 23:56:07 -07:00
debuggerd bundle init.rc contents with its service 2015-08-21 10:14:43 -07:00
fastboot Fix missing <stdarg.h>. 2015-08-25 19:34:13 -07:00
fs_mgr Add |opts| argument to android_fork_execvp_ext 2015-08-19 11:00:37 -07:00
healthd healthd: Adds cycle_count, current_now and full_charge properties. 2015-08-24 13:01:16 -07:00
include libcutils: cleanups for -fsanitize=integer 2015-08-26 10:40:00 -07:00
init init: import init rc scripts from file systems after mount_all 2015-08-21 10:14:43 -07:00
libbacktrace Display the map offset for each frame. 2015-08-20 14:07:30 -07:00
libcutils libcutils: enable LOCAL_SANITIZE := integer 2015-08-26 11:32:31 -07:00
libdiskconfig am eb075e28: am c8179498: am 2f62edf7: Merge "libdiskconfig: Turn on -Werror" 2014-05-21 21:19:27 +00:00
libion Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed. 2015-04-02 14:31:07 -07:00
liblog Use _WIN32 rather than HAVE_WINSOCK. 2015-07-29 17:45:24 -07:00
libmemtrack Add missing <malloc.h> and <string.h> includes. 2015-01-28 11:37:57 -08:00
libmincrypt Enable clang compilation. 2015-05-14 10:53:48 -07:00
libnativebridge Use __ANDROID__ instead of HAVE_ANDROID_OS. 2015-07-30 09:33:43 -07:00
libnetutils Use __ANDROID__ instead of HAVE_ANDROID_OS. 2015-07-30 09:33:43 -07:00
libpixelflinger To compile with llvm integrated assembler. 2015-08-21 15:58:26 -07:00
libprocessgroup Remove uses of libcxx.mk. 2015-03-27 11:24:04 -07:00
libsparse libsparse: use strcmp and validate last_used pointer 2015-08-21 14:23:31 +00:00
libsuspend Libsuspend: Remove unused variable 2014-11-24 18:53:44 -08:00
libsync Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed. 2015-04-02 14:31:07 -07:00
libsysutils Add missing <malloc.h> and <string.h> includes. 2015-01-28 11:37:57 -08:00
libusbhost am 0d8943c2: am e4c5b614: Merge "libusbhost: Fix IOCTL call during usb_request_cancel" 2014-08-12 21:05:43 +00:00
libutils libutils: Enable LOCAL_SANITIZE := integer 2015-08-24 10:51:38 -07:00
libziparchive Fix ODR issues in ART. 2015-06-29 16:27:44 -07:00
lmkd bundle init.rc contents with its service 2015-08-21 10:14:43 -07:00
logcat bundle init.rc contents with its service 2015-08-21 10:14:43 -07:00
logd logd: worst uid record watermark part deux 2015-08-24 14:04:45 -07:00
logwrapper Add FORK_EXECVP_OPTION_CAPTURE_OUTPUT to logwrap.h 2015-08-21 17:14:59 -07:00
metricsd Merge "metricsd: Give directory group permissions" 2015-08-21 16:39:26 +00:00
mkbootimg mkbootimg: misc typo fixes 2015-06-04 09:59:01 -07:00
reboot reboot: Turn on -Werror 2014-05-21 12:58:38 -07:00
rootdir remove TARGET_PROVIDES_INIT_RC 2015-08-24 13:56:43 -07:00
run-as package missing include for string.h 2015-04-01 11:15:37 -07:00
sdcard Move sdcard off PAGESIZE and onto PAGE_SIZE. 2015-07-28 16:36:47 -07:00
toolbox lsof fixes. 2015-08-24 17:21:31 -07:00
tzdatacheck Executable to run on boot that removes old tzdata if needed 2015-04-13 11:38:32 +01:00
.gitignore Ignore adb/*.pyc files 2015-08-11 12:59:58 -07:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:12:32 -07:00
CleanSpec.mk Add a CleanSpec for grep/toolbox. 2015-03-22 18:04:54 -07:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
NOTICE Fix omission in NOTICE file. 2013-07-30 13:56:55 -07:00