From a19ec739eb4a21cfe6b316c6793bdc82ad386698 Mon Sep 17 00:00:00 2001 From: Adam Murdoch Date: Tue, 28 Jan 2014 20:19:29 +1100 Subject: [PATCH] Fixes for handling of handle inheritance. --- src/main/cpp/win.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/cpp/win.cpp b/src/main/cpp/win.cpp index d08617e..68b3213 100755 --- a/src/main/cpp/win.cpp +++ b/src/main/cpp/win.cpp @@ -461,7 +461,9 @@ void uninheritStream(JNIEnv *env, DWORD stdInputHandle, jobject result) { } boolean ok = SetHandleInformation(streamHandle, HANDLE_FLAG_INHERIT, 0); if (!ok) { - mark_failed_with_errno(env, "could not change std handle", result); + if (GetLastError() != ERROR_INVALID_PARAMETER && GetLastError() != ERROR_INVALID_HANDLE) { + mark_failed_with_errno(env, "could not change std handle", result); + } } }