changeset 50871:79de7179761c

ZGC: TEMPORARY: Avoid compiler warnings about using the deprecated readdir_r
author duke
date Fri, 08 Jun 2018 18:24:44 +0200
parents 279d2d102714
children 22751e393c31
files src/java.base/unix/native/libjava/TimeZone_md.c src/java.base/unix/native/libjava/UnixFileSystem_md.c src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
diffstat 4 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libjava/TimeZone_md.c	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/java.base/unix/native/libjava/TimeZone_md.c	Fri Jun 08 18:24:44 2018 +0200
@@ -147,7 +147,14 @@
         return NULL;
     }
 
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     while (readdir64_r(dirp, entry, &dp) == 0 && dp != NULL) {
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
         /*
          * Skip '.' and '..' (and possibly other .* files)
          */
--- a/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Fri Jun 08 18:24:44 2018 +0200
@@ -339,7 +339,14 @@
     if (rv == NULL) goto error;
 
     /* Scan the directory */
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     while ((readdir64_r(dir, ptr, &result) == 0)  && (result != NULL)) {
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
         jstring name;
         if (!strcmp(ptr->d_name, ".") || !strcmp(ptr->d_name, ".."))
             continue;
--- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c	Fri Jun 08 18:24:44 2018 +0200
@@ -731,7 +731,14 @@
 
     /* EINTR not listed as a possible error */
     /* TDB: reentrant version probably not required here */
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     res = readdir64_r(dirp, ptr, &result);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 
 #ifdef _AIX
     /* On AIX, readdir_r() returns EBADF (i.e. '9') and sets 'result' to NULL for the */
--- a/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c	Fri Jun 08 18:24:44 2018 +0200
@@ -80,7 +80,14 @@
     return dbuf;
 #else /* __linux__ || _ALLBSD_SOURCE */
     struct dirent* p;
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     if (readdir_r(dirp, entry, &p) == 0) {
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
         return p;
     } else {
         return NULL;