src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c

Print this page

        

*** 2237,2248 **** fd = fd1; /* must be IPv6 only */ } optlen = sizeof(optval.i); if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) { ! char errmsg[255]; ! sprintf(errmsg, "error getting socket option: %s\n", strerror(errno)); JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", errmsg); return NULL; } switch (opt) { --- 2237,2251 ---- fd = fd1; /* must be IPv6 only */ } optlen = sizeof(optval.i); if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) { ! char tmpbuf[255]; ! int size = 0; ! char errmsg[255 + 31]; ! getErrorString(errno, tmpbuf, sizeof(tmpbuf)); ! sprintf(errmsg, "error getting socket option: %s", tmpbuf); JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", errmsg); return NULL; } switch (opt) {