diff options
author | Roger Meier <roger@apache.org> | 2014-07-08 07:46:11 +0200 |
---|---|---|
committer | Roger Meier <roger@apache.org> | 2014-07-08 07:46:11 +0200 |
commit | 2e9be756cea30243bc6071d898f37933deaf4f12 (patch) | |
tree | 41ce9c3d8159cc620f173e32b4b2a595623c696b /lib/cpp/src/thrift/transport | |
parent | 3e50a9a1d01950f356242aaab0cbf5fae778b81c (diff) | |
download | thrift-2e9be756cea30243bc6071d898f37933deaf4f12.tar.gz |
THRIFT-2610 MSVC warning in TSocket.cpp
Patch: Konrad Grochowski
Diffstat (limited to 'lib/cpp/src/thrift/transport')
-rwxr-xr-x | lib/cpp/src/thrift/transport/TSocket.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp index 7dec44200..e80f71287 100755 --- a/lib/cpp/src/thrift/transport/TSocket.cpp +++ b/lib/cpp/src/thrift/transport/TSocket.cpp @@ -622,7 +622,12 @@ void TSocket::setLinger(bool on, int linger) { return; } +#ifndef _WIN32 struct linger l = {(lingerOn_ ? 1 : 0), lingerVal_}; +#else + struct linger l = {(lingerOn_ ? 1 : 0), static_cast<u_short>(lingerVal_)}; +#endif + int ret = setsockopt(socket_, SOL_SOCKET, SO_LINGER, cast_sockopt(&l), sizeof(l)); if (ret == -1) { int errno_copy = THRIFT_GET_SOCKET_ERROR; // Copy THRIFT_GET_SOCKET_ERROR because we're allocating memory. |