diff --git a/fs/nfs/nfs_node.h b/fs/nfs/nfs_node.h index 6a3e22f549..cb5925f3b7 100644 --- a/fs/nfs/nfs_node.h +++ b/fs/nfs/nfs_node.h @@ -75,7 +75,7 @@ struct nfsnode uint8_t n_fhsize; /* Size in bytes of the file handle */ uint8_t n_flags; /* Node flags */ uint16_t n_mode; /* File mode for fstat() */ - struct timespec n_mtime; /* File modification time */ + time_t n_mtime; /* File modification time */ time_t n_ctime; /* File creation time */ nfsfh_t n_fhandle; /* NFS File Handle */ uint64_t n_size; /* Current size of file */ diff --git a/fs/nfs/nfs_util.c b/fs/nfs/nfs_util.c index 10d9762bdf..228e077b28 100644 --- a/fs/nfs/nfs_util.c +++ b/fs/nfs/nfs_util.c @@ -586,7 +586,9 @@ void nfs_attrupdate(FAR struct nfsnode *np, FAR struct nfs_fattr *attributes) np->n_mode = fxdr_unsigned(uint16_t, attributes->fa_mode); np->n_size = fxdr_hyper(&attributes->fa_size); - fxdr_nfsv3time(&attributes->fa_mtime, &np->n_mtime); + fxdr_nfsv3time(&attributes->fa_mtime, &ts); + np->n_mtime = ts.tv_sec; + fxdr_nfsv3time(&attributes->fa_ctime, &ts); np->n_ctime = ts.tv_sec; } diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index a11495084f..2051f97c58 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -1245,7 +1245,7 @@ static int nfs_fstat(FAR const struct file *filep, FAR struct stat *buf) /* Extract time values as type time_t in units of seconds. */ - info.ns_mtime = np->n_mtime.tv_sec; + info.ns_mtime = np->n_mtime; info.ns_ctime = np->n_ctime; /* Use the current time for the time of last access. */