[8u] RFR 8166148: Fix for JDK-8165936 broke Solaris builds

Aleksey Shipilev shade at redhat.com
Thu Jul 23 09:06:14 UTC 2020


Original bug:
  https://bugs.openjdk.java.net/browse/JDK-8166148
  https://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/8e4d88e06913

This is a followup for JDK-8165936 backport, which reverts parts of it. The hunk applies cleanly
when put into the old file at "solaris":

jdk8u-dev/jdk $ find | grep TimeZone_md.c
./src/solaris/native/java/util/TimeZone_md.c
./src/windows/native/java/util/TimeZone_md.c

8u patch:

diff -r 698607e7c543 src/solaris/native/java/util/TimeZone_md.c
--- a/src/solaris/native/java/util/TimeZone_md.c        Tue Sep 13 11:38:31 2016 +0200
+++ b/src/solaris/native/java/util/TimeZone_md.c        Thu Jul 23 10:49:43 2020 +0200
@@ -145,17 +145,11 @@
     if (dirp == NULL) {
         return NULL;
     }

     name_max = pathconf(dir, _PC_NAME_MAX);
-    // If pathconf did not work, fall back to NAME_MAX.
-    if (name_max < 0) {
-        name_max = NAME_MAX;
-    }
-    // Some older System V systems have a very small NAME_MAX size of 14; as
-    // there is no way to tell readdir_r the output buffer size, lets enforce
-    // a mimimum buffer size.
+    // If pathconf did not work, fall back to a mimimum buffer size.
     if (name_max < 1024) {
         name_max = 1024;
     }

     entry = (struct dirent64 *)malloc(offsetof(struct dirent64, d_name) + name_max + 1);

Testing: Linux x86_64 tier1

-- 
Thanks,
-Aleksey



More information about the jdk8u-dev mailing list