platform_system_core/base
Josh Gao 69d2f98197 adb: fix fd double close, Subprocess lifetime issue.
This commit fixes two somewhat related issues in shell_service.

  - The fd returned by StartSubprocess is owned by a unique_fd
    contained in the Subprocess object, but also gets closed by the
    caller. Resolve this by duping the returned file descriptor.

  - A Subprocess object can be destroyed immediately after its initial
    construction in StartSubprocess if we're sufficiently unlucky.
    Split up the fork/exec and "start management thread" steps, so that
    we can safely do everything we need to do on the Subprocess before
    handing it over to the thread that'll eventually destroy it.

Also includes squashed patches from AOSP master that allow for use of
unique_fd inside adb.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
(cherry picked from commit c0e6e40cc9)
(cherry picked from commit 54c72aaccc)
(cherry picked from commit 2c5d1d7cd9)
(cherry picked from commit 2a7b86337f)
(cherry picked from commit 13ea01db45)
(cherry picked from commit 344778da41)
2016-06-20 14:51:05 -07:00
..
include/android-base adb: fix fd double close, Subprocess lifetime issue. 2016-06-20 14:51:05 -07:00
.clang-format Revert "Revert "Create libbase."" 2015-03-16 10:08:46 -07:00
Android.mk Fix libbase's logging dependency. 2016-02-04 08:24:55 -08:00
CPPLINT.cfg Don't show lint errors for rvalue references. 2015-04-02 18:38:01 -07:00
errors_test.cpp base: add SystemErrorCodeToString() function. 2016-02-01 12:18:26 -08:00
errors_unix.cpp base: add SystemErrorCodeToString() function. 2016-02-01 12:18:26 -08:00
errors_windows.cpp base: add SystemErrorCodeToString() function. 2016-02-01 12:18:26 -08:00
file.cpp libziparchive: port unit tests to darwin and windows. 2016-03-07 11:21:24 -08:00
file_test.cpp base: add API to remove file if it exists. 2016-01-29 19:24:55 -08:00
logging.cpp Fix windows 64-bit builds 2016-02-25 18:43:55 -08:00
logging_test.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
parseint_test.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
parsenetaddress.cpp base: add network address parsing function from adb. 2016-01-21 20:03:33 -08:00
parsenetaddress_test.cpp base: add network address parsing function from adb. 2016-01-21 20:03:33 -08:00
stringprintf.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
stringprintf_test.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
strings.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
strings_test.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
test_main.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
test_utils.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
utf8.cpp Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
utf8_test.cpp Fix a couple sign-comparison warnings. 2016-01-15 12:18:14 -08:00