summaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-11-13 23:23:52 +0000
committerThomas Schwinge <tschwinge@gnu.org>2007-11-13 23:23:52 +0000
commitada287b189c35ff3b4737af1e857179a7cc6fa49 (patch)
treef03e971894f0667aedd9ea284e4c0af32050ee9b /nfs
parent6c6f86e0d6b4100d1a03032b82c385892f09e7d0 (diff)
2007-11-13 Thomas Schwinge <tschwinge@gnu.org>
* nfs.c (xdr_encode_sattr_stat, xdr_decode_fattr): Adapt to ``struct stat'' changes.
Diffstat (limited to 'nfs')
-rw-r--r--nfs/ChangeLog5
-rw-r--r--nfs/nfs.c41
2 files changed, 27 insertions, 19 deletions
diff --git a/nfs/ChangeLog b/nfs/ChangeLog
index 3d2f40d7..1777d4fc 100644
--- a/nfs/ChangeLog
+++ b/nfs/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-13 Thomas Schwinge <tschwinge@gnu.org>
+
+ * nfs.c (xdr_encode_sattr_stat, xdr_decode_fattr): Adapt to ``struct
+ stat'' changes.
+
2002-09-29 Marcus Brinkmann <marcus@gnu.org>
* mount.c (mount_root): Add parenthesis for post-decrement (even
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;