JDK-7146506 : (fc) Add EACCES check to the return of fcntl native method
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2012-02-17
  • Updated: 2014-10-13
  • Resolved: 2012-06-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b28Fixed
Description
FULL PRODUCT VERSION :


ADDITIONAL OS VERSION INFORMATION :
AIX HY-AIX64 1 7 000562E4D700

A DESCRIPTION OF THE PROBLEM :
  From the man page said:
F_SETLK :
...... If a conflicting lock is held by another process, this call returns -1 and sets errno  to EACCES or EAGAIN.

So EACCESS should be also checked for the sake the system is not return EAGAIN.

The native code is in the file "src/solaris/native/sun/nio/ch/FileDispatcherImpl.c" and fix is very straight-forward.


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION http://hg.openjdk.java.net/jdk8/tl/jdk/rev/de7f6d5841b6
20-02-2012