summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mark Salyzyn <salyzyn@google.com> 2014-04-08 15:21:50 -0700
committer Mark Salyzyn <salyzyn@google.com> 2014-04-08 16:17:51 -0700
commitb519aeca47a7b798926c00ce5c8cf730e26e75fd (patch)
treed665dd7d7f51e2011c54672e4a24ee64629b864a
parent3fb2b7132b64c65163e7c6cd948e45f703e93687 (diff)
jni: liblog reading error API incorrect
- return value contains -errno on error. Bug: 13907124 Change-Id: I91f12db5749fac2ae8ed5b0f033d4eaf83e666f5
-rw-r--r--core/jni/android_util_EventLog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp
index 25934200e0c9..8a0eaa26acda 100644
--- a/core/jni/android_util_EventLog.cpp
+++ b/core/jni/android_util_EventLog.cpp
@@ -177,13 +177,13 @@ static void android_util_EventLog_readEvents(JNIEnv* env, jobject clazz UNUSED,
break;
}
if (ret < 0) {
- if (errno == EINTR) {
+ if (ret == -EINTR) {
continue;
}
- if (errno == EINVAL) {
+ if (ret == -EINVAL) {
jniThrowException(env, "java/io/IOException", "Event too short");
- } else if (errno != EAGAIN) {
- jniThrowIOException(env, errno); // Will throw on return
+ } else if (ret != -EAGAIN) {
+ jniThrowIOException(env, -ret); // Will throw on return
}
break;
}