src/java.base/windows/native/libjli/java_md.c

Print this page

        

@@ -35,10 +35,11 @@
 #include <wtypes.h>
 #include <commctrl.h>
 
 #include <jni.h>
 #include "java.h"
+#include "jdk_strerror.h"
 
 #define JVM_DLL "jvm.dll"
 #define JAVA_DLL "java.dll"
 
 /*

@@ -519,10 +520,11 @@
 
     int save_errno = errno;
     DWORD       errval;
     jboolean freeit = JNI_FALSE;
     char  *errtext = NULL;
+    char buf[1024];
 
     va_start(vl, fmt);
 
     if ((errval = GetLastError()) != 0) {               /* Platform SDK / DOS Error */
         int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|

@@ -538,11 +540,12 @@
                 if (errtext[n - 1] == '\r') n--;
                 errtext[n] = '\0';
             }
         }
     } else {   /* C runtime error that has no corresponding DOS error code */
-        errtext = strerror(save_errno);
+        jdk_strerror(save_errno, buf, (size_t) 1024);
+        errtext = buf;
     }
 
     if (IsJavaw()) {
         char *message;
         int mlen;