Don't try to ignore the SIGPIPE signal if it isn't defined
authorChristopher Dykes <cdykes@fb.com>
Thu, 4 Aug 2016 22:37:49 +0000 (15:37 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 4 Aug 2016 22:38:24 +0000 (15:38 -0700)
Summary: Which is the case when compiling under MSVC.

Reviewed By: pixelb

Differential Revision: D3671357

fbshipit-source-id: b7e51479cae44933c3f1caa21d45775a32f294a3

folly/io/async/test/AsyncSSLSocketTest.cpp
folly/io/async/test/AsyncSSLSocketTest2.cpp

index dc60413099b2e98673a22e4bc7bf63baaf38a4ce..386f51ba21265681810d36f2cbdb4c5107949c48 100644 (file)
@@ -1890,6 +1890,7 @@ TEST(AsyncSSLSocketTest, ConnectTFOFallbackTimeout) {
 
 } // namespace
 
+#ifdef SIGPIPE
 ///////////////////////////////////////////////////////////////////////////
 // init_unit_test_suite
 ///////////////////////////////////////////////////////////////////////////
@@ -1901,3 +1902,4 @@ struct Initializer {
 };
 Initializer initializer;
 } // anonymous
+#endif
index ac79d7af5b9fd2dadbf89819dec1911ec2d747c4..e39f3b73585cd588eeea1b9b510ef77356349ab6 100644 (file)
@@ -131,7 +131,9 @@ TEST(AsyncSSLSocketTest2, AttachDetachSSLContext) {
 }  // folly
 
 int main(int argc, char *argv[]) {
+#ifdef SIGPIPE
   signal(SIGPIPE, SIG_IGN);
+#endif
   folly::SSLContext::setSSLLockTypes({
       {CRYPTO_LOCK_EVP_PKEY, folly::SSLContext::LOCK_NONE},
       {CRYPTO_LOCK_SSL_SESSION, folly::SSLContext::LOCK_SPINLOCK},