From f746b57e3c29d6be7db7273d4f169518b39429c8 Mon Sep 17 00:00:00 2001 From: sendaoYan Date: Thu, 12 Dec 2024 12:29:42 +0800 Subject: [PATCH] 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 --- src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c b/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c index f24a4eb9a2cea..d6ff51f801866 100644 --- a/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c +++ b/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c @@ -137,7 +137,9 @@ AWT_OnLoad(JavaVM *vm, void *reserved) } else { /* Get address of this library and the directory containing it. */ dladdr((void *)AWT_OnLoad, &dlinfo); - realpath((char *)dlinfo.dli_fname, buf); + if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { + perror((char *)dlinfo.dli_fname); + } len = strlen(buf); p = strrchr(buf, '/');