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:
parent
d2449123be
commit
2995eff3e3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user