aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/native/unix_jni.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/native/unix_jni.cc b/src/main/native/unix_jni.cc
index bf72dced9a..7615c67da4 100644
--- a/src/main/native/unix_jni.cc
+++ b/src/main/native/unix_jni.cc
@@ -399,11 +399,11 @@ static jobject StatCommon(JNIEnv *env,
// ENAMETOOLONGEFAULT -> RuntimeException
// ENOMEM -> OutOfMemoryError
- if (PostRuntimeException(env, errno, path_chars)) {
+ if (PostRuntimeException(env, saved_errno, path_chars)) {
::ReleaseStringLatin1Chars(path_chars);
return NULL;
} else if (should_throw) {
- ::PostFileException(env, errno, path_chars);
+ ::PostFileException(env, saved_errno, path_chars);
::ReleaseStringLatin1Chars(path_chars);
return NULL;
}