unix: fix compile error in Android using bionic

When compiling with bionic, st_atime_nsec (and the other nsec members)
canot be found.
In order to compile uv with both NDK and bionic, tv_nsec should be
accessed from st_atimensec (and the others nsec members).
See "Compatibility with glibc" in stat.h from bionic.

Signed-off-by: Robert Chiras <robert.chiras@intel.com>

PR-URL: https://github.com/libuv/libuv/pull/746
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Robert Chiras 2016-03-03 15:20:11 +02:00 committed by Saúl Ibarra Corretgé
parent cfef25dba2
commit 4c765d72a6

View File

@ -749,13 +749,13 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst->st_gen = src->st_gen;
#elif defined(__ANDROID__)
dst->st_atim.tv_sec = src->st_atime;
dst->st_atim.tv_nsec = src->st_atime_nsec;
dst->st_atim.tv_nsec = src->st_atimensec;
dst->st_mtim.tv_sec = src->st_mtime;
dst->st_mtim.tv_nsec = src->st_mtime_nsec;
dst->st_mtim.tv_nsec = src->st_mtimensec;
dst->st_ctim.tv_sec = src->st_ctime;
dst->st_ctim.tv_nsec = src->st_ctime_nsec;
dst->st_ctim.tv_nsec = src->st_ctimensec;
dst->st_birthtim.tv_sec = src->st_ctime;
dst->st_birthtim.tv_nsec = src->st_ctime_nsec;
dst->st_birthtim.tv_nsec = src->st_ctimensec;
dst->st_flags = 0;
dst->st_gen = 0;
#elif !defined(_AIX) && ( \