git: cpdup(1): Use POSIX-defined timespec fields to be more portable

Aaron LI aly at crater.dragonflybsd.org
Sat Apr 4 17:56:34 PDT 2020


commit 1a05b9d15ed4e0279e6992ceca212b8c9fefd8ae
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Apr 5 08:51:56 2020 +0800

    cpdup(1): Use POSIX-defined timespec fields to be more portable
    
    While we defines 'st_atimespec', 'st_mtimespec' and 'st_ctimespec'
    macros in 'struct stat', they are not defined on Linux and maybe other
    platforms or C libraries.  Change to check the definitions of
    'st_atime', 'st_mtime' and 'st_ctime' macros to check whether we're on a
    modern POSIX (>= 2008) platform.
    
    See also: https://github.com/DragonFlyBSD/cpdup/commit/7a715bd5cc6853c3973ce84a5df3c779e47082d1
    Credit: https://github.com/ninja-build/ninja/pull/1513

Summary of changes:
 bin/cpdup/cpdup.c   | 12 ++++++------
 bin/cpdup/hcproto.c | 18 +++++++++---------
 2 files changed, 15 insertions(+), 15 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1a05b9d15ed4e0279e6992ceca212b8c9fefd8ae


-- 
DragonFly BSD source repository



More information about the Commits mailing list