--- old/src/java.base/unix/native/libnet/SdpSupport.c 2015-09-04 21:38:12.844676999 +0530 +++ new/src/java.base/unix/native/libnet/SdpSupport.c 2015-09-04 21:38:12.668588999 +0530 @@ -119,5 +119,7 @@ if (res < 0) JNU_ThrowIOExceptionWithLastError(env, "dup2"); RESTARTABLE(close(s), res); + if (res < 0 && !(*env)->ExceptionOccurred(env)) + JNU_ThrowIOExceptionWithLastError(env, "close"); } }