summaryrefslogtreecommitdiffstats
path: root/sys/nfs/xdr_subs.h
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-01-10 13:11:42 +0000
committerdg <dg@FreeBSD.org>1995-01-10 13:11:42 +0000
commit07402e2728fdba34efce609c8ba56b125f7184c7 (patch)
treea91c8e5fc07425b16151850444ff3191a315864b /sys/nfs/xdr_subs.h
parent321000d1af23f8206984ae33d7abc3d77f0fedd8 (diff)
downloadFreeBSD-src-07402e2728fdba34efce609c8ba56b125f7184c7.zip
FreeBSD-src-07402e2728fdba34efce609c8ba56b125f7184c7.tar.gz
Fix conversion to/from nfs v2 time in handling microseconds.
Submitted by: rick@snowhite.cis.uoguelph.ca
Diffstat (limited to 'sys/nfs/xdr_subs.h')
-rw-r--r--sys/nfs/xdr_subs.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/nfs/xdr_subs.h b/sys/nfs/xdr_subs.h
index b081b11..ac00385 100644
--- a/sys/nfs/xdr_subs.h
+++ b/sys/nfs/xdr_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
- * $Id: xdr_subs.h,v 1.2 1994/08/02 07:52:30 davidg Exp $
+ * $Id: xdr_subs.h,v 1.3 1994/08/21 06:50:16 paul Exp $
*/
#ifndef _NFS_XDR_SUBS_H_
@@ -56,11 +56,17 @@
#define fxdr_nfstime(f, t) { \
(t)->ts_sec = ntohl(((struct nfsv2_time *)(f))->nfs_sec); \
- (t)->ts_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfs_usec); \
+ if (((struct nfsv2_time *)(f))->nfs_usec != 0xffffffff) \
+ (t)->ts_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfs_usec); \
+ else \
+ (t)->ts_nsec = -1; \
}
#define txdr_nfstime(f, t) { \
((struct nfsv2_time *)(t))->nfs_sec = htonl((f)->ts_sec); \
- ((struct nfsv2_time *)(t))->nfs_usec = htonl((f)->ts_nsec) / 1000; \
+ if ((f)->ts_nsec != -1) \
+ ((struct nfsv2_time *)(t))->nfs_usec = htonl((f)->ts_nsec / 1000); \
+ else \
+ ((struct nfsv2_time *)(t))->nfs_usec = 0xffffffff; \
}
#define fxdr_nqtime(f, t) { \
OpenPOWER on IntegriCloud