diff options
author | Elliott Hughes <enh@google.com> | 2014-11-10 10:48:25 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-11-10 10:48:25 -0800 |
commit | 4da9dc5a62c65b123087a08e124c446ea3a476d1 (patch) | |
tree | 11391a7652d335684d4201d2e85dca941398a02c /libs/androidfw | |
parent | 5cce4c752eeeaed74f815b9154ec7f4f3f2397ec (diff) | |
download | frameworks_base-4da9dc5a62c65b123087a08e124c446ea3a476d1.zip frameworks_base-4da9dc5a62c65b123087a08e124c446ea3a476d1.tar.gz frameworks_base-4da9dc5a62c65b123087a08e124c446ea3a476d1.tar.bz2 |
bionic's struct stat is now POSIX-compliant.
One less hack needed...
Bug: 18298106
Change-Id: I1e9e5ebf329bd6cbaf3445201f182793ee4871ce
Diffstat (limited to 'libs/androidfw')
-rw-r--r-- | libs/androidfw/BackupHelpers.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp index c78593d..3f82830 100644 --- a/libs/androidfw/BackupHelpers.cpp +++ b/libs/androidfw/BackupHelpers.cpp @@ -1307,23 +1307,12 @@ get_mod_time(const char* filename, struct timeval times[2]) fprintf(stderr, "stat '%s' failed: %s\n", filename, strerror(errno)); return errno; } - times[0].tv_sec = st.st_atime; - times[1].tv_sec = st.st_mtime; - - // If st_atime is a macro then struct stat64 uses struct timespec - // to store the access and modif time values and typically - // st_*time_nsec is not defined. In glibc, this is controlled by - // __USE_MISC. -#ifdef __USE_MISC -#if !defined(st_atime) || defined(st_atime_nsec) -#error "Check if this __USE_MISC conditional is still needed." -#endif + + times[0].tv_sec = st.st_atim.tv_sec; times[0].tv_usec = st.st_atim.tv_nsec / 1000; + + times[1].tv_sec = st.st_mtim.tv_sec; times[1].tv_usec = st.st_mtim.tv_nsec / 1000; -#else - times[0].tv_usec = st.st_atime_nsec / 1000; - times[1].tv_usec = st.st_mtime_nsec / 1000; -#endif return 0; } |