summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nfs/ChangeLog8
-rw-r--r--nfs/nfs.c4
-rw-r--r--nfs/ops.c15
3 files changed, 24 insertions, 3 deletions
diff --git a/nfs/ChangeLog b/nfs/ChangeLog
index 8e10ecb9..c213b5c6 100644
--- a/nfs/ChangeLog
+++ b/nfs/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jan 31 18:39:09 1999 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * nfs.c (xdr_encode_sattr_times): Convert nanoseconds to
+ microseconds correctly.
+
+ * ops.c (netfs_attempt_utimes): Handle new possibility that ATIME
+ or MTIME might be null.
+
1999-01-22 Roland McGrath <roland@baalperazim.frob.com>
* ops.c (netfs_attempt_link): Remove major, minor macro definitions.
diff --git a/nfs/nfs.c b/nfs/nfs.c
index 1c55f3f1..46c95c22 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -270,9 +270,9 @@ xdr_encode_sattr_times (int *p, struct timespec *atime, struct timespec *mtime)
*p++ = -1; /* gid */
*p++ = -1; /* size */
*p++ = htonl (atime->tv_sec);
- *p++ = htonl (atime->tv_nsec * 1000);
+ *p++ = htonl (atime->tv_nsec / 1000);
*p++ = htonl (mtime->tv_sec);
- *p++ = htonl (mtime->tv_nsec * 1000);
+ *p++ = htonl (mtime->tv_nsec / 1000);
}
else
{
diff --git a/nfs/ops.c b/nfs/ops.c
index 0f16fd85..f01ae2f5 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -276,11 +276,24 @@ netfs_attempt_utimes (struct iouser *cred, struct node *np,
int *p;
void *rpcbuf;
error_t err;
+ struct timeval tv;
+ struct timespec current;
+
+ /* XXX For version 3 we can actually do this right, but we don't
+ just yet. */
+ if (!atime || !mtime)
+ {
+ maptime_read (maptime, &tv);
+ current.tv_sec = tv.tv_sec;
+ current.tv_nsec = tv.tv_usec * 1000;
+ }
p = nfs_initialize_rpc (NFSPROC_SETATTR (protocol_version),
cred, 0, &rpcbuf, np, -1);
p = xdr_encode_fhandle (p, &np->nn->handle);
- p = xdr_encode_sattr_times (p, atime, mtime);
+ p = xdr_encode_sattr_times (p,
+ atime ?: current,
+ mtime ?: current);
if (protocol_version == 3)
*p++ = 0; /* guard check == 0 */