RFR: 8350869: os::stat doesn't follow symlinks on Windows [v3]

Anton Artemov duke at openjdk.org
Thu May 15 13:41:56 UTC 2025


On Thu, 15 May 2025 08:47:02 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8350869: Addressed reviewer's comments
>
> src/hotspot/os/windows/os_windows.cpp line 4614:
> 
>> 4612: 
>> 4613: // This method checks if a wide path is actually a symbolic link
>> 4614: static bool is_symbolic_link(const wchar_t* wide_path)
> 
> This is a `bool` function but you also set `errno` upon errors - how will anyone know that an error occurred?

I verified, one does not have to set `errno` here, as in both use cases of `is_symbolic_link()` the further code in os::stat() and os::open() checks a return value of a corresponding method and returns -1 in case of a problem. By this one knows that something went wrong. 

In this particular place one only needs to close a search handle by calling `FindClose()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25233#discussion_r2091201158


More information about the hotspot-runtime-dev mailing list