From ea0205bef9691755788871bffaeae8a4fff49a5d Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Mon, 24 Jun 2019 12:25:36 -0500 Subject: Redundantly set the l_linger member to appease gcc --- ACE/ace/SOCK_SEQPACK_Association.cpp | 5 +++++ TAO/tao/IIOP_Connection_Handler.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ACE/ace/SOCK_SEQPACK_Association.cpp b/ACE/ace/SOCK_SEQPACK_Association.cpp index 024de691a2e..def25b74165 100644 --- a/ACE/ace/SOCK_SEQPACK_Association.cpp +++ b/ACE/ace/SOCK_SEQPACK_Association.cpp @@ -52,6 +52,11 @@ ACE_SOCK_SEQPACK_Association::abort (void) linger slinger = { 0 }; slinger.l_onoff = 1; +#if !defined(ACE_HAS_LINGER_MS) + // Redundantly set the l_linger member to appease gcc + slinger.l_linger = 0; +#endif + if (-1 == ACE_OS::setsockopt (this->get_handle (), SOL_SOCKET, SO_LINGER, diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index bf4bb930103..12012fb0afe 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -669,6 +669,11 @@ TAO_IIOP_Connection_Handler::abort (void) struct linger lval = { 0 }; lval.l_onoff = 1; +#if !defined(ACE_HAS_LINGER_MS) + // Redundantly set the l_linger member to appease gcc + lval.l_linger = 0; +#endif + if (this->peer ().set_option(SOL_SOCKET, SO_LINGER, (void*) &lval, -- cgit v1.2.1 From 9a0cce755eeabf8bc71b749de9ff53dcc4e0d34a Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Tue, 25 Jun 2019 07:33:04 -0500 Subject: Provide two values in the struct linger initializer even though it absolutely is not required by the standard --- ACE/ace/SOCK_SEQPACK_Association.cpp | 7 +------ TAO/tao/IIOP_Connection_Handler.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ACE/ace/SOCK_SEQPACK_Association.cpp b/ACE/ace/SOCK_SEQPACK_Association.cpp index def25b74165..e1921645f2a 100644 --- a/ACE/ace/SOCK_SEQPACK_Association.cpp +++ b/ACE/ace/SOCK_SEQPACK_Association.cpp @@ -49,14 +49,9 @@ ACE_SOCK_SEQPACK_Association::abort (void) // setsockopt() SO_LINGER configures socket to reap immediately. // Normal close then aborts the association. // - linger slinger = { 0 }; + linger slinger = { 0, 0 }; slinger.l_onoff = 1; -#if !defined(ACE_HAS_LINGER_MS) - // Redundantly set the l_linger member to appease gcc - slinger.l_linger = 0; -#endif - if (-1 == ACE_OS::setsockopt (this->get_handle (), SOL_SOCKET, SO_LINGER, diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 12012fb0afe..552eff0856b 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -666,14 +666,9 @@ TAO_IIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean set_network_prio void TAO_IIOP_Connection_Handler::abort (void) { - struct linger lval = { 0 }; + struct linger lval = { 0, 0 }; lval.l_onoff = 1; -#if !defined(ACE_HAS_LINGER_MS) - // Redundantly set the l_linger member to appease gcc - lval.l_linger = 0; -#endif - if (this->peer ().set_option(SOL_SOCKET, SO_LINGER, (void*) &lval, -- cgit v1.2.1