From 1c9e763fc0a6249c66f10b46bc1496b494577ea4 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Fri, 9 Sep 2022 13:51:44 +0000 Subject: [PATCH] client: set nsec to 0 when converting stat struct on Windows The Windows stat structure has limitted timestamp precision. We'll ensure that the nsec field is properly initialized with 0. Signed-off-by: Lucian Petrut --- src/client/Client.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 39e1f519c24..7409478c1ab 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -8050,7 +8050,9 @@ void Client::stat_to_statx(struct stat *st, struct ceph_statx *stx) stx->stx_atime = st->st_atimespec; #elif __WIN32 stx->stx_mtime.tv_sec = st->st_mtime; + stx->stx_mtime.tv_nsec = 0 stx->stx_atime.tv_sec = st->st_atime; + stx->stx_atime.tv_nsec = 0 #else stx->stx_mtime = st->st_mtim; stx->stx_atime = st->st_atim; -- 2.39.5