8154996: [aix] Implement compare_file_modified_times for "8146879: Add option ..."
authorgoetz
Mon, 25 Apr 2016 12:42:29 +0200
changeset 38078 504a47bbbe5d
parent 38077 fbcc41d68cda
child 38079 fd24ad51113a
8154996: [aix] Implement compare_file_modified_times for "8146879: Add option ..." Reviewed-by: simonis
hotspot/src/os/aix/vm/os_aix.cpp
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Apr 25 17:24:33 2016 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Mon Apr 25 12:42:29 2016 +0200
@@ -4875,3 +4875,16 @@
   }
   return yes;
 }
+
+static inline time_t get_mtime(const char* filename) {
+  struct stat st;
+  int ret = os::stat(filename, &st);
+  assert(ret == 0, "failed to stat() file '%s': %s", filename, strerror(errno));
+  return st.st_mtime;
+}
+
+int os::compare_file_modified_times(const char* file1, const char* file2) {
+  time_t t1 = get_mtime(file1);
+  time_t t2 = get_mtime(file2);
+  return t1 - t2;
+}