jni: liblog reading error API incorrect

- return value contains -errno on error.

(cherry pick from commit b519aeca47)

Bug: 13907124
Change-Id: I91f12db5749fac2ae8ed5b0f033d4eaf83e666f5
This commit is contained in:
Mark Salyzyn
2014-04-08 15:21:50 -07:00
parent 97114e6062
commit 2760778d70

View File

@@ -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;
}