You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2014/07/08 07:46:43 UTC

git commit: THRIFT-2610 MSVC warning in TSocket.cpp

Repository: thrift
Updated Branches:
  refs/heads/master 3e50a9a1d -> 2e9be756c


THRIFT-2610 MSVC warning in TSocket.cpp

Patch: Konrad Grochowski


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2e9be756
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2e9be756
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2e9be756

Branch: refs/heads/master
Commit: 2e9be756cea30243bc6071d898f37933deaf4f12
Parents: 3e50a9a
Author: Roger Meier <ro...@apache.org>
Authored: Tue Jul 8 07:46:11 2014 +0200
Committer: Roger Meier <ro...@apache.org>
Committed: Tue Jul 8 07:46:11 2014 +0200

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TSocket.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/2e9be756/lib/cpp/src/thrift/transport/TSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
index 7dec442..e80f712 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.