RFR: 8327621: Check return value of uname in os::get_host_name [v2]

David Holmes dholmes at openjdk.org
Thu Mar 28 08:01:35 UTC 2024


On Tue, 26 Mar 2024 11:28:49 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> Trivial bug fix where we didn't check the return value of `uname(2)` on POSIX platforms. I checked callers of `get_host_name` and all wrap the calls in an `if` branch so they already handle failures.
>> 
>> Regards,
>> Johan
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Perform correct check and log warning

Changes requested by dholmes (Reviewer).

src/hotspot/os/posix/os_posix.cpp line 618:

> 616:     return true;
> 617:   }
> 618:   const char* errmsg = os::strerror(retcode);

That should be `errno` not `retcode`.

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

PR Review: https://git.openjdk.org/jdk/pull/18157#pullrequestreview-1965413574
PR Review Comment: https://git.openjdk.org/jdk/pull/18157#discussion_r1542470328


More information about the hotspot-runtime-dev mailing list