From ada287b189c35ff3b4737af1e857179a7cc6fa49 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 13 Nov 2007 23:23:52 +0000 Subject: 2007-11-13 Thomas Schwinge * nfs.c (xdr_encode_sattr_stat, xdr_decode_fattr): Adapt to ``struct stat'' changes. --- nfs/nfs.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'nfs/nfs.c') diff --git a/nfs/nfs.c b/nfs/nfs.c index 2628a570..4916df65 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -1,5 +1,8 @@ /* nfs.c - XDR frobbing and lower level routines for NFS client. - Copyright (C) 1995, 1996, 1997, 1999, 2002 Free Software Foundation, Inc. + + Copyright (C) 1995, 1996, 1997, 1999, 2002, 2007 + Free Software Foundation, Inc. + Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -335,10 +338,10 @@ xdr_encode_sattr_stat (int *p, *(p++) = htonl (st->st_uid); *(p++) = htonl (st->st_gid); *(p++) = htonl (st->st_size); - *(p++) = htonl (st->st_atime); - *(p++) = htonl (st->st_atime_usec); - *(p++) = htonl (st->st_mtime); - *(p++) = htonl (st->st_mtime_usec); + *(p++) = htonl (st->st_atim.tv_sec); + *(p++) = htonl (st->st_atim.tv_nsec / 1000); + *(p++) = htonl (st->st_mtim.tv_sec); + *(p++) = htonl (st->st_mtim.tv_nsec / 1000); } else { @@ -351,11 +354,11 @@ xdr_encode_sattr_stat (int *p, *(p++) = htonl (1); /* set size */ p = xdr_encode_64bit (p, st->st_size); *(p++) = htonl (SET_TO_CLIENT_TIME); /* set atime */ - *(p++) = htonl (st->st_atime); - *(p++) = htonl (st->st_atime_usec * 1000); + *(p++) = htonl (st->st_atim.tv_sec); + *(p++) = htonl (st->st_atim.tv_nsec); *(p++) = htonl (SET_TO_CLIENT_TIME); /* set mtime */ - *(p++) = htonl (st->st_mtime); - *(p++) = htonl (st->st_mtime_usec * 1000); + *(p++) = htonl (st->st_mtim.tv_sec); + *(p++) = htonl (st->st_mtim.tv_nsec); } return p; } @@ -442,24 +445,24 @@ xdr_decode_fattr (int *p, struct stat *st) p++; st->st_ino = ntohl (*p); p++; - st->st_atime = ntohl (*p); + st->st_atim.tv_sec = ntohl (*p); p++; - st->st_atime_usec = ntohl (*p); + st->st_atim.tv_nsec = ntohl (*p); p++; - st->st_mtime = ntohl (*p); + st->st_mtim.tv_sec = ntohl (*p); p++; - st->st_mtime_usec = ntohl (*p); + st->st_mtim.tv_nsec = ntohl (*p); p++; - st->st_ctime = ntohl (*p); + st->st_ctim.tv_sec = ntohl (*p); p++; - st->st_ctime_usec = ntohl (*p); + st->st_ctim.tv_nsec = ntohl (*p); p++; - if (protocol_version == 3) + if (protocol_version < 3) { - st->st_atime_usec /= 1000; - st->st_mtime_usec /= 1000; - st->st_ctime_usec /= 1000; + st->st_atim.tv_nsec *= 1000; + st->st_mtim.tv_nsec *= 1000; + st->st_ctim.tv_nsec *= 1000; } return p; -- cgit v1.2.3