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

Unified Diff: native_client_sdk/src/libraries/nacl_io/getdents_helper.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/getdents_helper.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/getdents_helper.cc b/native_client_sdk/src/libraries/nacl_io/getdents_helper.cc
index 87dc32de4d3c2b4d11b7ad7689e74fdf284c78e2..47cc694b792d7036f9799edc18891055fff75864 100644
--- a/native_client_sdk/src/libraries/nacl_io/getdents_helper.cc
+++ b/native_client_sdk/src/libraries/nacl_io/getdents_helper.cc
@@ -10,6 +10,8 @@
#include <algorithm>
+#include "nacl_io/log.h"
+
#include "sdk_util/macros.h"
namespace nacl_io {
@@ -63,12 +65,16 @@ Error GetDentsHelper::GetDents(size_t offs,
*out_bytes = 0;
// If the buffer pointer is invalid, fail
- if (NULL == pdir)
+ if (NULL == pdir) {
+ LOG_TRACE("dirent pointer is NULL.");
return EINVAL;
+ }
// If the buffer is too small, fail
- if (size < sizeof(dirent))
+ if (size < sizeof(dirent)) {
+ LOG_TRACE("dirent buffer size is too small: %d < %d", size, sizeof(dirent));
return EINVAL;
+ }
// Force size to a multiple of dirent
size -= size % sizeof(dirent);
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc ('k') | native_client_sdk/src/libraries/nacl_io/host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698