fix windows build, where hstrerror is not available

This commit is contained in:
Joel Dice 2008-07-21 15:29:02 -06:00
parent 5b94b17ea2
commit b59422fa94

View File

@ -95,7 +95,11 @@ init(JNIEnv* e, sockaddr_in* address, jstring hostString, jint port)
hostent* host = gethostbyname(chars);
e->ReleaseStringUTFChars(hostString, chars);
if (host == 0) {
#ifdef WIN32
throwIOException(e);
#else
throwIOException(e, hstrerror(h_errno));
#endif
return;
}
memset(address, 0, sizeof(sockaddr_in));