8205416: windows: fix checking of CloseHandle return code in Java_java_io_FileCleanable_cleanupClose0
Reviewed-by: alanb, stuefe
This commit is contained in:
parent
47b058cfad
commit
b0c5afb037
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -87,7 +87,7 @@ Java_java_io_FileDescriptor_close0(JNIEnv *env, jobject this) {
|
|||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_java_io_FileCleanable_cleanupClose0(JNIEnv *env, jclass fdClass, jint unused, jlong handle) {
|
Java_java_io_FileCleanable_cleanupClose0(JNIEnv *env, jclass fdClass, jint unused, jlong handle) {
|
||||||
if (handle != -1) {
|
if (handle != -1) {
|
||||||
if (CloseHandle((HANDLE)handle) == -1) {
|
if (!CloseHandle((HANDLE)handle)) {
|
||||||
JNU_ThrowIOExceptionWithLastError(env, "close failed");
|
JNU_ThrowIOExceptionWithLastError(env, "close failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user