7146506: (fc) Add EACCES check to the return of fcntl native method

Add EACCES check according to the spec of fcntl

Reviewed-by: alanb
This commit is contained in:
Charles Lee 2012-02-20 11:24:06 +08:00
parent d2449123be
commit 2995eff3e3

View File

@ -191,7 +191,7 @@ Java_sun_nio_ch_FileDispatcherImpl_lock0(JNIEnv *env, jobject this, jobject fdo,
}
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;