mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8186707: Remove libnio FileChannelImpl native close0() function
Remove Java_sun_nio_ch_FileChannelImpl_close0() on Unix and Windows and Java_sun_nio_ch_FileDispatcherImpl_closeByHandle on Windows only Reviewed-by: alanb
This commit is contained in:
parent
3d44d41bf8
commit
d5f19a429a
7 changed files with 9 additions and 49 deletions
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -54,7 +54,6 @@ SUNWprivate_1.1 {
|
|||
Java_sun_nio_ch_EPollPort_drain1;
|
||||
Java_sun_nio_ch_EPollPort_interrupt;
|
||||
Java_sun_nio_ch_EPollPort_socketpair;
|
||||
Java_sun_nio_ch_FileChannelImpl_close0;
|
||||
Java_sun_nio_ch_FileChannelImpl_initIDs;
|
||||
Java_sun_nio_ch_FileChannelImpl_map0;
|
||||
Java_sun_nio_ch_FileChannelImpl_position0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -37,7 +37,6 @@ SUNWprivate_1.1 {
|
|||
Java_sun_nio_ch_DatagramDispatcher_readv0;
|
||||
Java_sun_nio_ch_DatagramDispatcher_write0;
|
||||
Java_sun_nio_ch_DatagramDispatcher_writev0;
|
||||
Java_sun_nio_ch_FileChannelImpl_close0;
|
||||
Java_sun_nio_ch_FileChannelImpl_initIDs;
|
||||
Java_sun_nio_ch_FileChannelImpl_map0;
|
||||
Java_sun_nio_ch_FileChannelImpl_position0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -42,7 +42,6 @@ SUNWprivate_1.1 {
|
|||
Java_sun_nio_ch_DevPollArrayWrapper_poll0;
|
||||
Java_sun_nio_ch_DevPollArrayWrapper_register;
|
||||
Java_sun_nio_ch_DevPollArrayWrapper_registerMultiple;
|
||||
Java_sun_nio_ch_FileChannelImpl_close0;
|
||||
Java_sun_nio_ch_FileChannelImpl_initIDs;
|
||||
Java_sun_nio_ch_FileChannelImpl_map0;
|
||||
Java_sun_nio_ch_FileChannelImpl_position0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -140,18 +140,6 @@ Java_sun_nio_ch_FileChannelImpl_position0(JNIEnv *env, jobject this,
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_ch_FileChannelImpl_close0(JNIEnv *env, jobject this, jobject fdo)
|
||||
{
|
||||
jint fd = fdval(env, fdo);
|
||||
if (fd != -1) {
|
||||
jlong result = close(fd);
|
||||
if (result < 0) {
|
||||
JNU_ThrowIOExceptionWithLastError(env, "Close failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this,
|
||||
jobject srcFDO,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -176,7 +176,5 @@ class FileDispatcherImpl extends FileDispatcher {
|
|||
|
||||
static native void close0(FileDescriptor fd) throws IOException;
|
||||
|
||||
static native void closeByHandle(long fd) throws IOException;
|
||||
|
||||
static native long duplicateHandle(long fd) throws IOException;
|
||||
}
|
||||
|
|
|
@ -165,18 +165,6 @@ Java_sun_nio_ch_FileChannelImpl_position0(JNIEnv *env, jobject this,
|
|||
return (jlong)where.QuadPart;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_ch_FileChannelImpl_close0(JNIEnv *env, jobject this, jobject fdo)
|
||||
{
|
||||
HANDLE h = (HANDLE)(handleval(env, fdo));
|
||||
if (h != INVALID_HANDLE_VALUE) {
|
||||
BOOL result = CloseHandle(h);
|
||||
if (result == 0) {
|
||||
JNU_ThrowIOExceptionWithLastError(env, "Close failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this,
|
||||
jobject srcFD,
|
||||
|
|
|
@ -433,8 +433,10 @@ Java_sun_nio_ch_FileDispatcherImpl_release0(JNIEnv *env, jobject this,
|
|||
}
|
||||
}
|
||||
|
||||
static void closeFile(JNIEnv *env, jlong fd) {
|
||||
HANDLE h = (HANDLE)fd;
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_ch_FileDispatcherImpl_close0(JNIEnv *env, jclass clazz, jobject fdo)
|
||||
{
|
||||
HANDLE h = (HANDLE)handleval(env, fdo);
|
||||
if (h != INVALID_HANDLE_VALUE) {
|
||||
int result = CloseHandle(h);
|
||||
if (result == 0)
|
||||
|
@ -442,19 +444,6 @@ static void closeFile(JNIEnv *env, jlong fd) {
|
|||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_ch_FileDispatcherImpl_close0(JNIEnv *env, jclass clazz, jobject fdo)
|
||||
{
|
||||
jlong fd = handleval(env, fdo);
|
||||
closeFile(env, fd);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_ch_FileDispatcherImpl_closeByHandle(JNIEnv *env, jclass clazz, jlong fd)
|
||||
{
|
||||
closeFile(env, fd);
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_nio_ch_FileDispatcherImpl_duplicateHandle(JNIEnv *env, jclass this, jlong handle)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue