diff options
| author | 2017-03-03 10:41:46 +0000 | |
|---|---|---|
| committer | 2017-03-03 10:41:46 +0000 | |
| commit | 04d17c07ccda7b2f7d097a30e910ee0911decbfa (patch) | |
| tree | 68d754374b8fc41f7840111732c7efe1501b6192 | |
| parent | e6f3ed6aefcc3622e040343754b70757577bb9c9 (diff) | |
| parent | 9dbcff7d73883704b8552e33cf711e6d7c946b71 (diff) | |
Merge "fd_utils: add missing logging for a couple of failure cases."
am: 9dbcff7d73
Change-Id: Iabd49e8f322e926b1b157ff85f1e9e4f66b0f56a
| -rw-r--r-- | core/jni/fd_utils.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp index 59a536b1b001..5916020f8d7e 100644 --- a/core/jni/fd_utils.cpp +++ b/core/jni/fd_utils.cpp @@ -26,6 +26,7 @@ #include <sys/un.h> #include <unistd.h> +#include <android-base/logging.h> #include <android-base/strings.h> #include <cutils/log.h> @@ -224,6 +225,7 @@ FileDescriptorInfo* FileDescriptorInfo::CreateFromFd(int fd) { bool FileDescriptorInfo::Restat() const { struct stat f_stat; if (TEMP_FAILURE_RETRY(fstat(fd, &f_stat)) == -1) { + PLOG(ERROR) << "Unable to restat fd " << fd; return false; } @@ -312,7 +314,10 @@ bool FileDescriptorInfo::Readlink(const int fd, std::string* result) { // ext2 and ext4 both have PAGE_SIZE limitations, so we assume that here. char buf[4096]; ssize_t len = readlink(path, buf, sizeof(buf)); - if (len == -1) return false; + if (len == -1) { + PLOG(ERROR) << "Readlink on " << fd << " failed."; + return false; + } result->assign(buf, len); return true; |