OSDN Git Service

OpenJdkJVM: Fix JVM_Lseek
authorNarayan Kamath <narayan@google.com>
Fri, 15 Apr 2016 14:57:28 +0000 (15:57 +0100)
committerNarayan Kamath <narayan@google.com>
Fri, 15 Apr 2016 15:22:53 +0000 (16:22 +0100)
Use lseek64 and remove unnecessary TEMP_FAILURE_RETRY.

bug: 28192631

Change-Id: Ic27aa6c03122b29d53e75ead56870a8cb7867fd3

runtime/openjdkjvm/OpenjdkJvm.cc

index aff9b61..d010bab 100644 (file)
@@ -116,7 +116,12 @@ JNIEXPORT jint JVM_Write(jint fd, char* buf, jint nbytes) {
 
 /* posix lseek() */
 JNIEXPORT jlong JVM_Lseek(jint fd, jlong offset, jint whence) {
-    return TEMP_FAILURE_RETRY(lseek(fd, offset, whence));
+    // NOTE: Using TEMP_FAILURE_RETRY here is busted for LP32 on glibc - the return
+    // value will be coerced into an int32_t.
+    //
+    // lseek64 isn't specified to return EINTR so it shouldn't be necessary
+    // anyway.
+    return lseek64(fd, offset, whence);
 }
 
 /*