On Thu, 12 Dec 2024 19:53:12 GMT, Phil Race <p...@openjdk.org> wrote:
>> src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141: >> >>> 139: dladdr((void *)AWT_OnLoad, &dlinfo); >>> 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { >>> 141: perror((char *)dlinfo.dli_fname); >> >> Having error handling is better than no error handling, but is `perror` the >> best we can do? >> >> OTOH, maybe it doesn't matter as much. Something would be very, very broken >> if this were to fail. > > I saw this in another bug report too from the same submitter. > I don't know that I want to encourage this as a pattern, except in debug > builds. better might be to just copy dlinfo.dli_fname into buf .. `perror` will print the given message accrording the previous `errno` info to stderr, so this change will not change the original behaviour. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883201733