diff options
author | Neil Fuller <nfuller@google.com> | 2014-04-17 13:22:20 +0100 |
---|---|---|
committer | Neil Fuller <nfuller@google.com> | 2014-06-03 17:50:15 +0100 |
commit | 8add3229ceb13f2aa5d15b84cc59f5ecc6b90214 (patch) | |
tree | 7ad1916a89d9221a0bc2f8663f996ac16a89b4ac /luni/src/main/native | |
parent | 919849b0be531c7969aa83cb96f7c2d8688896c5 (diff) | |
download | libcore-8add3229ceb13f2aa5d15b84cc59f5ecc6b90214.zip libcore-8add3229ceb13f2aa5d15b84cc59f5ecc6b90214.tar.gz libcore-8add3229ceb13f2aa5d15b84cc59f5ecc6b90214.tar.bz2 |
Add interruptibility/wake on close to FileChannel.lock()
There is no obvious way of automated testing given the test
would have to spawn a separate process to lock a file (and
flock is not available on devices). It has been tested
manually with multiple processes on host and a device.
Bug: 13927110
Change-Id: Ie2e565d4965e7aa6392b0eb32e55cdf50d7f61c5
Diffstat (limited to 'luni/src/main/native')
-rw-r--r-- | luni/src/main/native/libcore_io_Posix.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/luni/src/main/native/libcore_io_Posix.cpp b/luni/src/main/native/libcore_io_Posix.cpp index 2721758..c04f73e 100644 --- a/luni/src/main/native/libcore_io_Posix.cpp +++ b/luni/src/main/native/libcore_io_Posix.cpp @@ -594,8 +594,7 @@ static jint Posix_fcntlFlock(JNIEnv* env, jobject, jobject javaFd, jint cmd, job lock.l_len = env->GetLongField(javaFlock, lenFid); lock.l_pid = env->GetIntField(javaFlock, pidFid); - int fd = jniGetFDFromFileDescriptor(env, javaFd); - int rc = throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd, &lock))); + int rc = IO_FAILURE_RETRY(env, int, fcntl, javaFd, cmd, &lock); if (rc != -1) { env->SetShortField(javaFlock, typeFid, lock.l_type); env->SetShortField(javaFlock, whenceFid, lock.l_whence); |