Include errno name in error messages, if the errno is known.

This commit is contained in:
Adam Murdoch
2013-02-16 11:14:41 +11:00
parent 0c5d0dfe80
commit 01c4f26e97
7 changed files with 26 additions and 13 deletions

View File

@@ -29,7 +29,14 @@
#include <string.h>
void mark_failed_with_errno(JNIEnv *env, const char* message, jobject result) {
mark_failed_with_code(env, message, errno, result);
const char * errno_message = NULL;
switch(errno) {
case ENOENT:
errno_message = "ENOENT";
break;
}
mark_failed_with_code(env, message, errno, errno_message, result);
}
char* java_to_char(JNIEnv *env, jstring string, jobject result) {