diff options
author | Ralph Boehme <slow@samba.org> | 2019-08-30 14:49:47 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2019-09-10 21:13:09 +0000 |
commit | cb09104951cdefba991464e486c536b06356fd25 (patch) | |
tree | 5c272f5702f1bce3756318dd149084eca34c592e /source3/lib/system.c | |
parent | 4930920648ad6879a72c77d79508025478dcbaa2 (diff) | |
download | samba-cb09104951cdefba991464e486c536b06356fd25.tar.gz |
s3:lib: add update_stat_ex_from_saved_stat()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ac18730f10ce96a607a3a07e1360b522ebf72f38)
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r-- | source3/lib/system.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index a67388e436a..0620439c944 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -355,6 +355,26 @@ void update_stat_ex_file_id(struct stat_ex *dst, uint64_t file_id) dst->st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_FILE_ID; } +void update_stat_ex_from_saved_stat(struct stat_ex *dst, + const struct stat_ex *src) +{ + if (!VALID_STAT(*src)) { + return; + } + + if (!(src->st_ex_iflags & ST_EX_IFLAG_CALCULATED_BTIME)) { + update_stat_ex_create_time(dst, src->st_ex_btime); + } + + if (!(src->st_ex_iflags & ST_EX_IFLAG_CALCULATED_ITIME)) { + update_stat_ex_itime(dst, src->st_ex_itime); + } + + if (!(src->st_ex_iflags & ST_EX_IFLAG_CALCULATED_FILE_ID)) { + update_stat_ex_file_id(dst, src->st_ex_file_id); + } +} + void init_stat_ex_from_stat (struct stat_ex *dst, const struct stat *src, bool fake_dir_create_times) |