Fixes for handling of handle inheritance.

This commit is contained in:
Adam Murdoch
2014-01-28 20:19:29 +11:00
parent f82362beef
commit a19ec739eb

View File

@@ -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);
}
}
}