diff --git a/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h b/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h index d6810d61bed3fab2372ab236bd82be45a078765c..3ceab1de30e1655c295fed8496b415cd736a45da 100644 --- a/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h @@ -329,6 +329,6 @@ extern sctp_freepaddrs_func* nio_sctp_freepaddrs; extern sctp_bindx_func* nio_sctp_bindx; extern sctp_peeloff_func* nio_sctp_peeloff; -jboolean loadSocketExtensionFuncs(JNIEnv* env); +extern jint sctpHandleSocketError(JNIEnv *env, jint errorValue); #endif /* !SUN_NIO_CH_SCTP_H */ diff --git a/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c index 63000d8ed19c9852cc31938db84036cb06f7dad2..2c2ad2f63a4b555399081eba4812d396984a6328 100644 --- a/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c @@ -28,7 +28,6 @@ #include "Sctp.h" #include "jni.h" -#include "nio_util.h" #include "nio.h" #include "net_util.h" #include "net_util_md.h" @@ -70,7 +69,7 @@ static jmethodID ss_ctrID; /* sun.nio.ch.sctp.Shutdown. */ /* defined in SctpNet.c */ jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr); -jint handleSocketError(JNIEnv *env, jint errorValue); + /* use SocketChannelImpl's checkConnect implementation */ extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env, @@ -247,7 +246,7 @@ void handleSendFailed if (remaining > 0) { if ((rv = recvmsg(fd, msg, 0)) < 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return; } @@ -454,7 +453,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 #endif /* __linux__ */ } else { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return 0; } } @@ -478,7 +477,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 iov->iov_base = newBuf + rv; iov->iov_len = SCTP_NOTIFICATION_SIZE - rv; if ((rv = recvmsg(fd, msg, flags)) < 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return 0; } bufp = newBuf; @@ -593,7 +592,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_send0 JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket is shutdown for writing"); } else { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return 0; } } diff --git a/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c index 51ffa2404d6c2d643b65af223de48954d5c69dc7..c5d1678542ce4852eccfd052faa38776352a4fe5 100644 --- a/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c @@ -30,7 +30,6 @@ #include "Sctp.h" #include "jni.h" #include "jni_util.h" -#include "nio_util.h" #include "nio.h" #include "net_util.h" #include "net_util_md.h" @@ -63,7 +62,7 @@ static int preCloseFD = -1; /* File descriptor to which we dup other fd's * functions, as well as locating the individual functions. * There will be a pending exception if this method returns false. */ -jboolean loadSocketExtensionFuncs +static jboolean loadSocketExtensionFuncs (JNIEnv* env) { if (dlopen(nativeSctpLib, RTLD_GLOBAL | RTLD_LAZY) == NULL) { JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", @@ -118,7 +117,7 @@ jboolean loadSocketExtensionFuncs } jint -handleSocketError(JNIEnv *env, jint errorValue) +sctpHandleSocketError(JNIEnv *env, jint errorValue) { char *xn; switch (errorValue) { @@ -190,7 +189,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpNet_socket0 fd = socket(domain, (oneToOne ? SOCK_STREAM : SOCK_SEQPACKET), IPPROTO_SCTP); if (fd < 0) { - return handleSocketError(env, errno); + return sctpHandleSocketError(env, errno); } /* Enable events */ @@ -204,7 +203,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpNet_socket0 //event.sctp_partial_delivery_event = 1; //event.sctp_adaptation_layer_event = 1; if (setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, sizeof(event)) != 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); } return fd; } @@ -242,7 +241,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_bindx if (nio_sctp_bindx(fd, (void*)sap, addrsLength, add ? SCTP_BINDX_ADD_ADDR : SCTP_BINDX_REM_ADDR) != 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); } free(sap); @@ -257,7 +256,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_listen0 (JNIEnv *env, jclass cl, jint fd, jint backlog) { if (listen(fd, backlog) < 0) - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); } /* @@ -284,7 +283,7 @@ Java_sun_nio_ch_sctp_SctpNet_connect0 } else if (errno == EINTR) { return IOS_INTERRUPTED; } - return handleSocketError(env, errno); + return sctpHandleSocketError(env, errno); } return 1; } @@ -365,7 +364,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0 #else /* __linux__ */ if ((addrCount = nio_sctp_getladdrs(fd, 0, (struct sockaddr **)&addr_buf)) == -1) { #endif - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return NULL; } @@ -417,7 +416,7 @@ jobjectArray getRemoteAddresses #else /* __linux__ */ if ((addrCount = nio_sctp_getpaddrs(fd, id, (struct sockaddr**)&addr_buf)) == -1) { #endif - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); return NULL; } @@ -745,7 +744,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_shutdown0 msg->msg_controllen = cmsg->cmsg_len; if ((rv = sendmsg(fd, msg, 0)) < 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); } } @@ -758,7 +757,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_branch0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { int newfd = 0; if ((newfd = nio_sctp_peeloff(fd, assocId)) < 0) { - handleSocketError(env, errno); + sctpHandleSocketError(env, errno); } return newfd;