Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
3e50a9a
)
THRIFT-2610 MSVC warning in TSocket.cpp
author
Roger Meier
<roger@apache.org>
Tue, 8 Jul 2014 05:46:11 +0000
(07:46 +0200)
committer
Roger Meier
<roger@apache.org>
Tue, 8 Jul 2014 05:46:11 +0000
(07:46 +0200)
Patch: Konrad Grochowski
lib/cpp/src/thrift/transport/TSocket.cpp
patch
|
blob
|
history
diff --git
a/lib/cpp/src/thrift/transport/TSocket.cpp
b/lib/cpp/src/thrift/transport/TSocket.cpp
index
7dec442
..
e80f712
100755
(executable)
--- 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.