< prev index next >

src/java.base/unix/native/libnet/SdpSupport.c

Print this page

        

@@ -116,8 +116,10 @@
             setsockopt(s, SOL_SOCKET, SO_LINGER, (char*)&linger, len);
 
         RESTARTABLE(dup2(s, fd), res);
         if (res < 0)
             JNU_ThrowIOExceptionWithLastError(env, "dup2");
-        RESTARTABLE(close(s), res);
+        res = close(s);
+        if (res < 0 && !(*env)->ExceptionOccurred(env))
+            JNU_ThrowIOExceptionWithLastError(env, "close");
     }
 }
< prev index next >