Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 8b636c6

Browse files
committedMar 10, 2020
8240796: Infinite loop in Diagnostic message code
1 parent 26d9a07 commit 8b636c6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@
7777
J2dRlsTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_initMTL");
7878

7979
FILE *f = popen("system_profiler SPDisplaysDataType", "r");
80-
int ch = getc(f);
8180
bool metalSupport = FALSE;
82-
while (ch != EOF)
81+
while (getc(f) != EOF)
8382
{
8483
char str[60];
8584

@@ -95,10 +94,10 @@
9594
}
9695
pclose(f);
9796
if (!metalSupport) {
98-
fprintf(stderr, "Metal support not present");
97+
fprintf(stderr, "Metal support not present\n");
9998
return JNI_FALSE;
10099
} else {
101-
fprintf(stderr, "Metal support is present");
100+
fprintf(stderr, "Metal support is present\n");
102101
}
103102

104103
if (!MTLFuncs_OpenLibrary()) {

0 commit comments

Comments
 (0)