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
--- 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;