summaryrefslogtreecommitdiff
path: root/nfs/ops.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-01-31 23:50:36 +0000
committerThomas Bushnell <thomas@gnu.org>1999-01-31 23:50:36 +0000
commit991964495b65f3f6d3a043d8fc5b7fe8c20728d3 (patch)
tree4872af8f9cd29e10441b8a77eae6530abf2de685 /nfs/ops.c
parent3ffa3f5df170bc879cc852c64a7e04fdc027f363 (diff)
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.
Diffstat (limited to 'nfs/ops.c')
-rw-r--r--nfs/ops.c15
1 files changed, 14 insertions, 1 deletions
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 */