equal
deleted
inserted
replaced
6006 yes = false; |
6006 yes = false; |
6007 } |
6007 } |
6008 return yes; |
6008 return yes; |
6009 } |
6009 } |
6010 |
6010 |
6011 |
6011 static inline struct timespec get_mtime(const char* filename) { |
|
6012 struct stat st; |
|
6013 int ret = os::stat(filename, &st); |
|
6014 assert(ret == 0, "failed to stat() file '%s': %s", filename, strerror(errno)); |
|
6015 return st.st_mtim; |
|
6016 } |
|
6017 |
|
6018 int os::compare_file_modified_times(const char* file1, const char* file2) { |
|
6019 struct timespec filetime1 = get_mtime(file1); |
|
6020 struct timespec filetime2 = get_mtime(file2); |
|
6021 int diff = filetime1.tv_sec - filetime2.tv_sec; |
|
6022 if (diff == 0) { |
|
6023 return filetime1.tv_nsec - filetime2.tv_nsec; |
|
6024 } |
|
6025 return diff; |
|
6026 } |
6012 |
6027 |
6013 /////////////// Unit tests /////////////// |
6028 /////////////// Unit tests /////////////// |
6014 |
6029 |
6015 #ifndef PRODUCT |
6030 #ifndef PRODUCT |
6016 |
6031 |