RFR: 8342086: FileInputStream.available() fails with "Incorrect function" for "nul" path (win)

Alan Bateman alanb at openjdk.org
Mon Dec 2 19:17:40 UTC 2024


On Wed, 16 Oct 2024 16:56:38 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Modify the `handleAvailable` native code path to ignore an `ERROR_INVALID_FUNCTION` encountered by `PeekNamedPipe` and update an existing test to verify this change.

src/java.base/windows/native/libjava/io_util_md.c line 357:

> 355:         if (lastError != ERROR_BROKEN_PIPE &&
> 356:             lastError != ERROR_INVALID_FUNCTION) {
> 357:             return FALSE;

What would you think about not special case these errors and instead pbytes=0 and TRUE if PeekNamedPipe fails.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21543#discussion_r1866472851


More information about the core-libs-dev mailing list