diff options
author | David Pursell <dpursell@google.com> | 2015-09-11 16:06:59 -0700 |
---|---|---|
committer | David Pursell <dpursell@google.com> | 2015-09-11 18:28:27 -0700 |
commit | 4127ca96e296fb5dff2eee572210cae825d8de6b (patch) | |
tree | a0100f88a1b5aaa6cb15678906d97149046a7f0e /shell_service_protocol_test.cpp | |
parent | a642cbe2aa7b3b0d3615a0fe8004836f3354f51d (diff) | |
download | adb-4127ca96e296fb5dff2eee572210cae825d8de6b.tar.gz |
adb: fix shell_service_protocol_test for Windows.
Adds missing #ifdef guards to shell_service_protocol_test.cpp so the
test compiles on Windows.
Also fixes a bug in Windows socketpair write implementation. Previously
it was only checking for a closed pipe if the write happened to block.
This adds an additional pre-check to exit immediately on a closed pipe.
These two changes allow the test to compile and pass on Windows.
Change-Id: Ib8853ed72f015fc0d623da47c32982cb3ffa4a3d
Diffstat (limited to 'shell_service_protocol_test.cpp')
-rw-r--r-- | shell_service_protocol_test.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/shell_service_protocol_test.cpp b/shell_service_protocol_test.cpp index 85b2f91..a826035 100644 --- a/shell_service_protocol_test.cpp +++ b/shell_service_protocol_test.cpp @@ -72,13 +72,17 @@ class ShellProtocolTest : public ::testing::Test { read_protocol_->buffer_end_ = read_protocol_->data() + size; } +#if !defined(_WIN32) static sig_t saved_sigpipe_handler_; +#endif int read_fd_ = -1, write_fd_ = -1; ShellProtocol *read_protocol_ = nullptr, *write_protocol_ = nullptr; }; +#if !defined(_WIN32) sig_t ShellProtocolTest::saved_sigpipe_handler_ = nullptr; +#endif namespace { |