# HG changeset patch # User stuefe # Date 1496136751 -7200 # Node ID e83d34c399ee23f6d2e0e7440602bb10577ac1a9 # Parent 6e4a400d1f2ca2c156d36c0b47b28b815d6434fa 8181207: 8177809 breaks AIX 5.3, 6.1 builds Reviewed-by: diff --git a/src/java.base/unix/native/libjava/UnixFileSystem_md.c b/src/java.base/unix/native/libjava/UnixFileSystem_md.c --- a/src/java.base/unix/native/libjava/UnixFileSystem_md.c +++ b/src/java.base/unix/native/libjava/UnixFileSystem_md.c @@ -229,6 +229,10 @@ WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) { struct stat64 sb; if (stat64(path, &sb) == 0) { +#ifdef _AIX + /* AIX 5.3 backward compatibility. */ + rv = 1000 * (jlong)sb.st_mtime; +#else #ifndef MACOSX rv = (jlong)sb.st_mtim.tv_sec * 1000; rv += (jlong)sb.st_mtim.tv_nsec / 1000000; @@ -236,6 +240,7 @@ rv = (jlong)sb.st_mtimespec.tv_sec * 1000; rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000; #endif +#endif } } END_PLATFORM_STRING(env, path); return rv; @@ -419,6 +424,10 @@ struct timeval tv[2]; /* Preserve access time */ +#ifdef _AIX + tv[0].tv_sec = sb.st_atime; + tv[0].tv_usec = 0; +#else #ifndef MACOSX tv[0].tv_sec = sb.st_atim.tv_sec; tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; @@ -426,7 +435,7 @@ tv[0].tv_sec = sb.st_atimespec.tv_sec; tv[0].tv_usec = sb.st_atimespec.tv_nsec / 1000; #endif - +#endif /* Change last-modified time */ tv[1].tv_sec = time / 1000; tv[1].tv_usec = (time % 1000) * 1000;