[9] RFR of 8139133: Changing the modification time on a unix domain socket file fails

Alan Bateman Alan.Bateman at oracle.com
Wed Oct 21 01:27:57 UTC 2015


On 21/10/2015 02:05, Brian Burkhalter wrote:
> Please review at your convenience.
>
> Issue:	https://bugs.openjdk.java.net/browse/JDK-8139133
> Patch:	http://cr.openjdk.java.net/~bpb/8139133/webrev.00/
>
> The exception is caused by the native open(2) system call's failing with errno ENXIO, "No such device or address.” The fix is to use equivalent methods which do not depend on the file descriptor’s being available.
>
Catching IOException doesn't look right. Instead, I think this will need 
re-visiting openForAttributeAccess so that you can examine the errno and 
only fallback to the file path for ENXIO and maybe a few other errors.

A minor comment is renaming isFdValid to haveFd could make the usages a 
bit clearer.

Does the test have a race? It looks like it might attempt to accept the 
socket file before the nc command creates it. Also can the test be moved 
to attribute/BasicFileAttributeView as that is where the tests for 
setTimes are (it's not a test for the FileTime class).

-Alan.


More information about the nio-dev mailing list