From 2995eff3e367ce944a83f1bc51fb3c7f5fe0925d Mon Sep 17 00:00:00 2001 From: Charles Lee Date: Mon, 20 Feb 2012 11:24:06 +0800 Subject: [PATCH] 7146506: (fc) Add EACCES check to the return of fcntl native method Add EACCES check according to the spec of fcntl Reviewed-by: alanb --- jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c b/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c index 6468ee9a39f..f7310bab157 100644 --- a/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c @@ -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;