Skip to content

Commit 367c304

Browse files
author
SendaoYan
committed
8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17
Reviewed-by: ihse
1 parent 31ceec7 commit 367c304

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ AWT_OnLoad(JavaVM *vm, void *reserved)
137137
} else {
138138
/* Get address of this library and the directory containing it. */
139139
dladdr((void *)AWT_OnLoad, &dlinfo);
140-
realpath((char *)dlinfo.dli_fname, buf);
140+
if (realpath((char *)dlinfo.dli_fname, buf) == NULL) {
141+
perror((char *)dlinfo.dli_fname);
142+
}
141143
len = strlen(buf);
142144
p = strrchr(buf, '/');
143145

0 commit comments

Comments
 (0)