# HG changeset patch # User littlee # Date 1329708246 -28800 # Node ID 384d1c31d539e9a7e6b3c57b91bd3f0a62ef20eb # Parent c021db66251d2fb01f25f67bf7d47e2890e6f0cc 7146506: (fc) Add EACCES check to the return of fcntl native method Summary: Add EACCES check according to the spec of fcntl Reviewed-by: alanb diff -r c021db66251d -r 384d1c31d539 jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c --- a/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c Sun Feb 19 16:51:35 2012 +0000 +++ b/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c Mon Feb 20 11:24:06 2012 +0800 @@ -191,7 +191,7 @@ } lockResult = fcntl(fd, cmd, &fl); if (lockResult < 0) { - if ((cmd == F_SETLK64) && (errno == EAGAIN)) + if ((cmd == F_SETLK64) && (errno == EAGAIN || errno == EACCES)) return sun_nio_ch_FileDispatcherImpl_NO_LOCK; if (errno == EINTR) return sun_nio_ch_FileDispatcherImpl_INTERRUPTED;