RFR: 8364816: GetLastError() in os_windows.cpp should not store value to errno [v6]

Anton Artemov duke at openjdk.org
Mon Sep 1 09:51:31 UTC 2025


On Mon, 1 Sep 2025 09:45:47 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8364816: Addressed reviewer's comment.
>
> src/hotspot/os/windows/os_windows.cpp line 4822:
> 
>> 4820:     if (errcode == ERROR_FILE_NOT_FOUND || errcode == ERROR_PATH_NOT_FOUND) {
>> 4821:       errno = ENOENT;
>> 4822:     }
> 
> To maintain the old behavior, we should set errno to 0 to avoid reading an old value of a previous error stored in errno, which could change the behavior or either succeeding or crashing in aotClassLocation.cpp.
> 
> Suggestion:
> 
>     } else {
>       _set_errno(0);
>     }

I think it is a good catch, let's add it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26901#discussion_r2313453433


More information about the hotspot-runtime-dev mailing list