]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: set nsec to 0 when converting stat struct on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 9 Sep 2022 13:51:44 +0000 (13:51 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 10 Nov 2022 07:38:13 +0000 (09:38 +0200)
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 <lpetrut@cloudbasesolutions.com>
src/client/Client.cc

index 39e1f519c243d690d141c30c3439961765f35175..7409478c1ab1c1d37aacb7969d2fd3a58fb68a77 100644 (file)
@@ -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;