summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-11-05 12:03:31 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-11-05 12:04:17 -0500
commit6e9f52c9a8d51cac7db3b62e799fc32072c86443 (patch)
tree2cf2e0acb149421e710ea6b285fdbe7b69d516ba /printf.c
parent7f8bacca4c2b1d35bb65ddf8cbf70fadf1adf66e (diff)
downloadbfs-6e9f52c9a8d51cac7db3b62e799fc32072c86443.tar.xz
Add support for file birth/creation times on platforms that have it
Fixes #19
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c12
1 files changed, 9 insertions, 3 deletions
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() */