lib/util: Standardize use of st_[acm]time ns
authorMatthew DeVore <matvore@google.com>
Wed, 5 Aug 2020 00:49:42 +0000 (17:49 -0700)
committerVolker Lendecke <vl@samba.org>
Sat, 15 Aug 2020 08:51:09 +0000 (08:51 +0000)
commit53a1d034f3e47ed3c5ec4f9b6ca0d2d695e8d873
tree72b6383b6acb69c79b7b5f96ff49104bba4f5c1b
parent9f7ef21e008f15e2ad8049230aeede1f72fe45a3
lib/util: Standardize use of st_[acm]time ns

Commit 810397f89a10, and possibly others, broke the build for macOS and
other environments which don't have st_[acm]tim fields on 'struct stat'.

Multiple places in the codebase used the config.h values to determine
how to access the nanosecond or microsecond values of the stat
timestamps, so rather than add more, centralize them all into
lib/util/time.c.

Also allow pvfs_fileinfo.c to read nanosecond-granularity timestamps on
platforms where it didn't before, since its #if branches were not
complete.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Aug 15 08:51:09 UTC 2020 on sn-devel-184
lib/replace/wscript
lib/util/time.c
lib/util/time.h
source3/lib/system.c
source3/libsmb/libsmb_stat.c
source4/ntvfs/posix/pvfs_fileinfo.c
source4/torture/libsmbclient/libsmbclient.c