Module Name: src
Committed By: mrg
Date: Wed Jul 6 09:02:54 UTC 2011
Modified Files:
src/sbin/mount_nfs: getnfsargs_small.c
Log Message:
switch from an ugly cast and ntohl() usage to be32dec(). use sizeof.
idea from dh, and fixes a GCC 4.5 warning.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/mount_nfs/getnfsargs_small.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/mount_nfs/getnfsargs_small.c
diff -u src/sbin/mount_nfs/getnfsargs_small.c:1.8 src/sbin/mount_nfs/getnfsargs_small.c:1.9
--- src/sbin/mount_nfs/getnfsargs_small.c:1.8 Tue Apr 29 06:53:01 2008
+++ src/sbin/mount_nfs/getnfsargs_small.c Wed Jul 6 09:02:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: getnfsargs_small.c,v 1.8 2008/04/29 06:53:01 martin Exp $ */
+/* $NetBSD: getnfsargs_small.c,v 1.9 2011/07/06 09:02:54 mrg Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: getnfsargs_small.c,v 1.8 2008/04/29 06:53:01 martin Exp $");
+__RCSID("$NetBSD: getnfsargs_small.c,v 1.9 2011/07/06 09:02:54 mrg Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -248,8 +248,8 @@
nfsargsp->fh = nfhret.nfh;
if (nfsvers == NFS_VER3) {
- nfsargsp->fhsize = ntohl(*(uint32_t *)nfhret.nfh);
- nfsargsp->fh += 4;
+ nfsargsp->fhsize = be32dec(nfhret.nfh);
+ nfsargsp->fh += sizeof(uint32_t);
} else {
nfsargsp->fhsize = NFSX_V2FH;
nfsargsp->flags &= ~NFSMNT_NFSV3;