From 6e9f52c9a8d51cac7db3b62e799fc32072c86443 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 5 Nov 2017 12:03:31 -0500 Subject: Add support for file birth/creation times on platforms that have it Fixes #19 --- printf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'printf.c') diff --git a/printf.c b/printf.c index 3c32108..9157ccb 100644 --- a/printf.c +++ b/printf.c @@ -87,10 +87,16 @@ static const struct timespec *get_time_field(const struct stat *statbuf, enum ti return &statbuf->st_ctim; case MTIME: return &statbuf->st_mtim; - } - assert(false); - return NULL; +#ifdef BFS_HAVE_ST_BIRTHTIM + case BTIME: + return &statbuf->st_birthtim; +#endif + + default: + assert(false); + return NULL; + } } /** %c, %c, and %t: ctime() */ -- cgit v1.2.3