From: Lucian Petrut Date: Fri, 9 Sep 2022 13:51:44 +0000 (+0000) Subject: client: set nsec to 0 when converting stat struct on Windows X-Git-Tag: v18.1.0~369^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c9e763fc0a6249c66f10b46bc1496b494577ea4;p=ceph.git 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 39e1f519c243..7409478c1ab1 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;