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

Unified Diff: native_client_sdk/src/libraries/nacl_io/devfs/tty_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/devfs/tty_node.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc b/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
index d237fdddd1fe25b7cb1a810cc19c0ab6de940d90..f1f7a26dd4a644139a580a92489ebce9653d69e7 100644
--- a/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
@@ -89,8 +89,11 @@ Error TtyNode::Write(const HandleAttr& attr,
*out_bytes = 0;
// No handler registered.
- if (output_handler_.handler == NULL)
+ if (output_handler_.handler == NULL) {
+ // No error here; many of the tests trigger this message.
+ LOG_TRACE("No output handler registered.");
return EIO;
+ }
int rtn = output_handler_.handler(
static_cast<const char*>(buf), count, output_handler_.user_data);
@@ -170,19 +173,19 @@ Error TtyNode::Echo(const char* string, int count) {
Error TtyNode::ProcessInput(PP_Var message) {
if (message.type != PP_VARTYPE_STRING) {
- LOG_ERROR("ProcessInput: expected VarString but got %d.", message.type);
+ LOG_ERROR("Expected VarString but got %d.", message.type);
return EINVAL;
}
PepperInterface* ppapi = filesystem_->ppapi();
if (!ppapi) {
- LOG_ERROR("ProcessInput: ppapi is NULL.");
+ LOG_ERROR("ppapi is NULL.");
return EINVAL;
}
VarInterface* var_iface = ppapi->GetVarInterface();
if (!var_iface) {
- LOG_ERROR("ProcessInput: Var interface pointer is NULL.");
+ LOG_ERROR("Got NULL interface: Var");
return EINVAL;
}
@@ -265,8 +268,10 @@ Error TtyNode::VIoctl(int request, va_list args) {
output_handler_.handler = NULL;
return 0;
}
- if (output_handler_.handler != NULL)
+ if (output_handler_.handler != NULL) {
+ LOG_ERROR("Output handler already set.");
return EALREADY;
+ }
output_handler_ = *arg;
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698