Hey, all; did this get resolved? I'm still getting this error in
pulled-yesterday clones of jdk8u and jdk9 and jdk10. I would prefer not to
make local changes (mostly I want to build debug builds so I can spelunk the
JVM bits), but if this isn't going to roll out fairly shortly I'll disable
warnings-as-errors and carry on.

Ted Neward
Technologist and Leader
T: @tedneward | M: (425) 647-4526
http://www.newardassociates.com

-----Original Message-----
From: build-dev <build-dev-boun...@openjdk.java.net> On Behalf Of Pengfei Li
Sent: Thursday, June 28, 2018 3:01 AM
To: kim.barr...@oracle.com; bsr...@gmail.com
Cc: build-dev@openjdk.java.net; nd <n...@arm.com>;
core-libs-...@openjdk.java.net
Subject: RFR: 8202794: Native Unix code should use readdir rather than
readdir_r

Hi

Last month, Bernard proposed a patch to fix the OpenJDK build issue with
recent versions of glibc.
See
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-May/052991.html
But this fix requires to be tested on all POSIX systems before getting
integrated.

As recently, more and more guys are complaining about the OpenJDK build
failure issue, shall we just add the following workaround to upstream before
Bernard's real fix eventually merged?


diff --git a/src/java.base/unix/native/libjava/TimeZone_md.c
b/src/java.base/unix/native/libjava/TimeZone_md.c
index f0bb362afc..e156381acd 100644
--- a/src/java.base/unix/native/libjava/TimeZone_md.c
+++ b/src/java.base/unix/native/libjava/TimeZone_md.c
@@ -146,7 +146,7 @@ findZoneinfoFile(char *buf, size_t size, const char
*dir)
         (void) closedir(dirp);
         return NULL;
     }
-
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     while (readdir64_r(dirp, entry, &dp) == 0 && dp != NULL) {
         /*
          * Skip '.' and '..' (and possibly other .* files) diff --git
a/src/java.base/unix/native/libjava/UnixFileSystem_md.c
b/src/java.base/unix/native/libjava/UnixFileSystem_md.c
index 315aa92b64..5b9554dd47 100644
--- a/src/java.base/unix/native/libjava/UnixFileSystem_md.c
+++ b/src/java.base/unix/native/libjava/UnixFileSystem_md.c
@@ -339,6 +339,7 @@ Java_java_io_UnixFileSystem_list(JNIEnv *env, jobject
this,
     if (rv == NULL) goto error;

     /* Scan the directory */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     while ((readdir64_r(dir, ptr, &result) == 0)  && (result != NULL)) {
         jstring name;
         if (!strcmp(ptr->d_name, ".") || !strcmp(ptr->d_name, "..")) diff
--git a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
index 53bb1c1009..72c38eb9a6 100644
--- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
+++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
@@ -731,6 +731,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv*
env, jclass this, jlong val

     /* EINTR not listed as a possible error */
     /* TDB: reentrant version probably not required here */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     res = readdir64_r(dirp, ptr, &result);

#ifdef _AIX
diff --git
a/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
b/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
index 1adeaf7bb5..080cf2a89b 100644
--- a/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
+++ b/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemIm
+++ pl.c
@@ -80,6 +80,7 @@ static struct dirent* read_dir(DIR* dirp, struct dirent*
entry) {
     return dbuf;
#else /* __linux__ || _ALLBSD_SOURCE */
     struct dirent* p;
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     if (readdir_r(dirp, entry, &p) == 0) {
         return p;
     } else {


--
Thanks,
Pengfei

Reply via email to