src/solaris/native/java/lang/UNIXProcess_md.c

Print this page

        

*** 290,305 **** throwIOException(JNIEnv *env, int errnum, const char *defaultDetail) { static const char * const format = "error=%d, %s"; const char *detail = defaultDetail; char *errmsg; jstring s; if (errnum != 0) { ! const char *s = strerror(errnum); ! if (strcmp(s, "Unknown error") != 0) ! detail = s; } /* ASCII Decimal representation uses 2.4 times as many bits as binary. */ errmsg = NEW(char, strlen(format) + strlen(detail) + 3 * sizeof(errnum)); if (errmsg == NULL) return; --- 290,306 ---- throwIOException(JNIEnv *env, int errnum, const char *defaultDetail) { static const char * const format = "error=%d, %s"; const char *detail = defaultDetail; char *errmsg; + char tmpbuf[1024]; jstring s; if (errnum != 0) { ! int ret = getErrorString(errnum, tmpbuf, sizeof(tmpbuf)); ! if (ret != EINVAL) ! detail = tmpbuf; } /* ASCII Decimal representation uses 2.4 times as many bits as binary. */ errmsg = NEW(char, strlen(format) + strlen(detail) + 3 * sizeof(errnum)); if (errmsg == NULL) return;