diff --git a/classpath/java-nio.cpp b/classpath/java-nio.cpp index 08b391bc6b..e82f34f0dd 100644 --- a/classpath/java-nio.cpp +++ b/classpath/java-nio.cpp @@ -95,8 +95,11 @@ init(JNIEnv* e, sockaddr_in* address, jstring hostString, jint port) hostent* host = gethostbyname(chars); e->ReleaseStringUTFChars(hostString, chars); if (host == 0) { - // herror("init: gethostbyname"); +#ifdef WIN32 throwIOException(e); +#else + throwIOException(e, hstrerror(h_errno)); +#endif return; } memset(address, 0, sizeof(sockaddr_in)); @@ -236,7 +239,10 @@ makeSocket(JNIEnv* e, bool blocking = false) #endif int s = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (s < 0) { throwIOException(e); return s; } + if (s < 0) { + throwIOException(e); + return s; + } if (not blocking) makeNonblocking(e, s); @@ -260,9 +266,11 @@ Java_java_nio_channels_ServerSocketChannel_natDoListen(JNIEnv *e, { int s = makeSocket(e); if (s < 0) return s; + if (e->ExceptionOccurred()) return 0; sockaddr_in address; init(e, &address, host, port); + if (e->ExceptionOccurred()) return 0; ::doListen(e, s, &address); return s; @@ -276,9 +284,11 @@ Java_java_nio_channels_SocketChannel_natDoConnect(JNIEnv *e, jbooleanArray retVal) { int s = makeSocket(e); - + if (e->ExceptionOccurred()) return 0; + sockaddr_in address; init(e, &address, host, port); + if (e->ExceptionOccurred()) return 0; jboolean connected = ::doConnect(e, s, &address); e->SetBooleanArrayRegion(retVal, 0, 1, &connected); diff --git a/classpath/java/lang/Override.java b/classpath/java/lang/Override.java new file mode 100644 index 0000000000..ce25b9559a --- /dev/null +++ b/classpath/java/lang/Override.java @@ -0,0 +1,5 @@ +package java.lang; + +public @interface Override { + +} diff --git a/src/machine.cpp b/src/machine.cpp index 2af1664492..ef44e79169 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -52,8 +52,8 @@ Thread** fill(Thread* t, Thread* o, Thread** array) { if (t != o) *(array++) = t; - if (t->peer) fill(t->peer, o, array); - if (t->child) fill(t->child, o, array); + if (t->peer) array = fill(t->peer, o, array); + if (t->child) array = fill(t->child, o, array); return array; }