On Thu, 5 Sep 2024 21:03:56 GMT, David Holmes <[email protected]> wrote:
>> Simon Tooke has updated the pull request incrementally with two additional
>> commits since the last revision:
>>
>> - simplify windwos realpath() implementation
>> - get rid of os::posix::realpath() and os::win32::realpath()
>
> src/hotspot/os/windows/os_windows.cpp line 5330:
>
>> 5328: if (result == nullptr) {
>> 5329: errno = ENAMETOOLONG;
>> 5330: }
>
> This is a bit of an assumption. What if the name "includes a drive letter
> that isn't valid or can't be found"? Unfortunately Windows doesn't specify
> any further details beyond returning null.
I probably cleaned up this code too much, and should've left it more like the
Posix implementation.
What I used to have would do one call (with buffer NULL) to get the real full
path, then copy it if it fit or ENAMETOOLONG. In attempting to speed up the
code I changed the semantics. I will change this code back to my previous
implementation
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1754801308