Merge "adb: "support" O_CLOEXEC in adb_open on Windows." am: 9c4fda6cd2 am: c1f4e167b6

am: e90e12de63

Change-Id: Ie2952b103020716afebadfaa13ecd593ed671117
This commit is contained in:
Josh Gao 2019-02-07 23:11:42 -08:00 committed by android-build-merger
commit ec30852d8d
1 changed files with 3 additions and 0 deletions

View File

@ -356,6 +356,9 @@ int adb_open(const char* path, int options) {
DWORD desiredAccess = 0;
DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
// CreateFileW is inherently O_CLOEXEC by default.
options &= ~O_CLOEXEC;
switch (options) {
case O_RDONLY:
desiredAccess = GENERIC_READ;