changeset 45297:df90da0c10aa

8181207: 8177809 breaks AIX 5.3, 6.1 builds Reviewed-by: vtewari, simonis, clanger
author stuefe
date Thu, 01 Jun 2017 08:59:24 +0200
parents ae7b350fabcb
children 6cfa262c0b3d
files jdk/src/java.base/unix/native/libjava/UnixFileSystem_md.c
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Thu Jun 01 11:10:22 2017 +0800
+++ b/jdk/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Thu Jun 01 08:59:24 2017 +0200
@@ -229,12 +229,15 @@
     WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
         struct stat64 sb;
         if (stat64(path, &sb) == 0) {
-#ifndef MACOSX
+#if defined(_AIX)
+            rv =  (jlong)sb.st_mtime * 1000;
+            rv += (jlong)sb.st_mtime_n / 1000000;
+#elif defined(MACOSX)
+            rv  = (jlong)sb.st_mtimespec.tv_sec * 1000;
+            rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000;
+#else
             rv  = (jlong)sb.st_mtim.tv_sec * 1000;
             rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
-#else
-            rv  = (jlong)sb.st_mtimespec.tv_sec * 1000;
-            rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000;
 #endif
         }
     } END_PLATFORM_STRING(env, path);
@@ -419,14 +422,16 @@
             struct timeval tv[2];
 
             /* Preserve access time */
-#ifndef MACOSX
+#if defined(_AIX)
+            tv[0].tv_sec = sb.st_atime;
+            tv[0].tv_usec = sb.st_atime_n / 1000;
+#elif defined(MACOSX)
+            tv[0].tv_sec = sb.st_atimespec.tv_sec;
+            tv[0].tv_usec = sb.st_atimespec.tv_nsec / 1000;
+#else
             tv[0].tv_sec = sb.st_atim.tv_sec;
             tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
-#else
-            tv[0].tv_sec = sb.st_atimespec.tv_sec;
-            tv[0].tv_usec = sb.st_atimespec.tv_nsec / 1000;
 #endif
-
             /* Change last-modified time */
             tv[1].tv_sec = time / 1000;
             tv[1].tv_usec = (time % 1000) * 1000;