Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Unified Diff: native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc

Issue 176923017: [NaCl SDK] Compile for naclio for Bionic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug in h_error Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc b/native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc
index bb9c171813d4a22e85b3f719d603081bd53bb58d..06e45e67ecd09a25036173805f9a4d986b8aaa5a 100644
--- a/native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc
@@ -318,7 +318,7 @@ Error TcpNode::GetSockOpt(int lvl, int optname, void* optval, socklen_t* len) {
if (lvl == IPPROTO_TCP && optname == TCP_NODELAY) {
AUTO_LOCK(node_lock_);
int value = tcp_nodelay_;
- socklen_t value_len = sizeof(value);
+ socklen_t value_len = static_cast<socklen_t>(sizeof(value));
int copy_bytes = std::min(value_len, *len);
memcpy(optval, &value, copy_bytes);
*len = value_len;
@@ -345,7 +345,7 @@ Error TcpNode::SetSockOpt(int lvl,
const void* optval,
socklen_t len) {
if (lvl == IPPROTO_TCP && optname == TCP_NODELAY) {
- if (len < sizeof(int))
+ if (static_cast<size_t>(len) < sizeof(int))
return EINVAL;
AUTO_LOCK(node_lock_);
tcp_nodelay_ = *static_cast<const int*>(optval) != 0;

Powered by Google App Engine
This is Rietveld 408576698