Fix FileModificationTime for Android

Traditional NDK headers provide the nanoseconds field of modification
time as st_mtime_nsec, rather than contained in a timespec st_mtim.
Unified headers do provide the timespec st_mtim.

Bug: crashpad:206
Change-Id: I701ac2d5e357a13855a2a674f1355f2ea125ee4e
Reviewed-on: https://chromium-review.googlesource.com/760618
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2017-11-09 10:37:58 -08:00 committed by Commit Bot
parent 6f6f8a144d
commit 13e17bf90f

View File

@ -34,6 +34,10 @@ bool FileModificationTime(const base::FilePath& path, timespec* mtime) {
#if defined(OS_MACOSX)
*mtime = st.st_mtimespec;
#elif defined(OS_ANDROID)
// This is needed to compile with traditional NDK headers.
mtime->tv_sec = st.st_mtime;
mtime->tv_nsec = st.st_mtime_nsec;
#else
*mtime = st.st_mtim;
#endif