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

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

Issue 349703003: [NaCl SDK] Add some more logging to nacl_io. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux host build Created 6 years, 6 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 28915aaf13a7bd37cdd1abbee1ef297a091e79f8..df7c8670b812caef41352c6ceec5db9fc6dc2633 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
@@ -11,6 +11,7 @@
#include <algorithm>
#include "nacl_io/kernel_handle.h"
+#include "nacl_io/log.h"
#include "nacl_io/pepper_interface.h"
#include "nacl_io/socket/tcp_node.h"
#include "nacl_io/stream/stream_fs.h"
@@ -287,8 +288,10 @@ Error TcpNode::Init(int open_flags) {
if (err != 0)
return err;
- if (TCPInterface() == NULL)
+ if (TCPInterface() == NULL) {
+ LOG_ERROR("Got NULL interface: TCP");
return EACCES;
+ }
if (socket_resource_ != 0) {
// TCP sockets that are contructed with an existing socket_resource_
@@ -299,8 +302,10 @@ Error TcpNode::Init(int open_flags) {
} else {
socket_resource_ =
TCPInterface()->Create(filesystem_->ppapi()->GetInstance());
- if (0 == socket_resource_)
+ if (0 == socket_resource_) {
+ LOG_ERROR("Unable to create TCP resource.");
return EACCES;
+ }
SetStreamFlags(SSF_CAN_CONNECT);
}
@@ -483,6 +488,7 @@ Error TcpNode::Shutdown(int how) {
AUTO_LOCK(node_lock_);
if (!IsConnected())
return ENOTCONN;
+
{
AUTO_LOCK(emitter_->GetLock());
emitter_->SetError_Locked();
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/log.h ('k') | native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698