--- a/src/java.base/unix/native/libjava/TimeZone_md.c Tue Sep 17 08:22:14 2019 -0400
+++ b/src/java.base/unix/native/libjava/TimeZone_md.c Tue Sep 17 16:39:56 2019 +0000
@@ -130,11 +130,6 @@
char *tz = NULL;
int res;
- dirp = opendir(dir);
- if (dirp == NULL) {
- return NULL;
- }
-
if (strcmp(dir, ZONEINFO_DIR) == 0) {
/* fast path for 1st iteration */
for (unsigned int i = 0; i < sizeof (popularZones) / sizeof (popularZones[0]); i++) {
@@ -151,6 +146,11 @@
}
}
+ dirp = opendir(dir);
+ if (dirp == NULL) {
+ return NULL;
+ }
+
while ((dp = readdir(dirp)) != NULL) {
/*
* Skip '.' and '..' (and possibly other .* files)