7146506: (fc) Add EACCES check to the return of fcntl native method
authorlittlee
Mon, 20 Feb 2012 11:24:06 +0800
changeset 11908 384d1c31d539
parent 11907 c021db66251d
child 11909 a1a7165ac1fa
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
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;