changeset 41578:6bc194dea076

8157749: Improve handling of DNS error replies Reviewed-by: chegar, rriggs, coffeys
author msheppar
date Fri, 15 Jul 2016 20:57:41 +0100
parents d4852d03014f
children c0fe2e6364d9
files jdk/src/java.base/unix/native/libnet/net_util_md.c jdk/src/java.base/windows/native/libnet/net_util_md.c
diffstat 2 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/unix/native/libnet/net_util_md.c	Thu Jul 14 11:55:09 2016 -0700
+++ b/jdk/src/java.base/unix/native/libnet/net_util_md.c	Fri Jul 15 20:57:41 2016 +0100
@@ -273,13 +273,10 @@
 
 #endif
 
-
 void
 NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
                    const char *defaultDetail) {
-    char errmsg[255];
-    sprintf(errmsg, "errno: %d, error: %s\n", errno, defaultDetail);
-    JNU_ThrowByNameWithLastError(env, name, errmsg);
+    JNU_ThrowByNameWithMessageAndLastError(env, name, defaultDetail);
 }
 
 void
--- a/jdk/src/java.base/windows/native/libnet/net_util_md.c	Thu Jul 14 11:55:09 2016 -0700
+++ b/jdk/src/java.base/windows/native/libnet/net_util_md.c	Fri Jul 15 20:57:41 2016 +0100
@@ -205,9 +205,7 @@
 void
 NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
                    const char *defaultDetail) {
-    char errmsg[255];
-    sprintf(errmsg, "errno: %d, error: %s\n", WSAGetLastError(), defaultDetail);
-    JNU_ThrowByNameWithLastError(env, name, errmsg);
+    JNU_ThrowByNameWithMessageAndLastError(env, name, defaultDetail);
 }
 
 jfieldID