summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shishkin2010-10-22 13:35:47 +0200
committerDenys Vlasenko2010-10-22 13:35:47 +0200
commit54779a47e9fa7f85b2a2ff744b9121f31a7758a9 (patch)
treecac5bc9838528cad938c7ef3db0e7537e86981af
parent6722737ece4b8db3e30b53aef8f981f53db1621e (diff)
downloadbusybox-54779a47e9fa7f85b2a2ff744b9121f31a7758a9.zip
busybox-54779a47e9fa7f85b2a2ff744b9121f31a7758a9.tar.gz
mount: code shrink (-81 bytes)
Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--util-linux/mount.c56
1 files changed, 15 insertions, 41 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 5e85f99..3ac8ce0 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -775,78 +775,52 @@ static char *nfs_strerror(int status)
static bool_t xdr_fhandle(XDR *xdrs, fhandle objp)
{
- if (!xdr_opaque(xdrs, objp, FHSIZE))
- return FALSE;
- return TRUE;
+ return xdr_opaque(xdrs, objp, FHSIZE);
}
static bool_t xdr_fhstatus(XDR *xdrs, fhstatus *objp)
{
if (!xdr_u_int(xdrs, &objp->fhs_status))
return FALSE;
- switch (objp->fhs_status) {
- case 0:
- if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle))
- return FALSE;
- break;
- default:
- break;
- }
+ if (objp->fhs_status == 0)
+ return xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle);
return TRUE;
}
static bool_t xdr_dirpath(XDR *xdrs, dirpath *objp)
{
- if (!xdr_string(xdrs, objp, MNTPATHLEN))
- return FALSE;
- return TRUE;
+ return xdr_string(xdrs, objp, MNTPATHLEN);
}
static bool_t xdr_fhandle3(XDR *xdrs, fhandle3 *objp)
{
- if (!xdr_bytes(xdrs, (char **)&objp->fhandle3_val,
- (unsigned int *) &objp->fhandle3_len,
- FHSIZE3)
- ) {
- return FALSE;
- }
- return TRUE;
+ return xdr_bytes(xdrs, (char **)&objp->fhandle3_val,
+ (unsigned int *) &objp->fhandle3_len,
+ FHSIZE3);
}
static bool_t xdr_mountres3_ok(XDR *xdrs, mountres3_ok *objp)
{
if (!xdr_fhandle3(xdrs, &objp->fhandle))
return FALSE;
- if (!xdr_array(xdrs, &(objp->auth_flavours.auth_flavours_val),
- &(objp->auth_flavours.auth_flavours_len),
- ~0,
- sizeof(int),
- (xdrproc_t) xdr_int)
- ) {
- return FALSE;
- }
- return TRUE;
+ return xdr_array(xdrs, &(objp->auth_flavours.auth_flavours_val),
+ &(objp->auth_flavours.auth_flavours_len),
+ ~0,
+ sizeof(int),
+ (xdrproc_t) xdr_int);
}
static bool_t xdr_mountstat3(XDR *xdrs, mountstat3 *objp)
{
- if (!xdr_enum(xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
+ return xdr_enum(xdrs, (enum_t *) objp);
}
static bool_t xdr_mountres3(XDR *xdrs, mountres3 *objp)
{
if (!xdr_mountstat3(xdrs, &objp->fhs_status))
return FALSE;
- switch (objp->fhs_status) {
- case MNT_OK:
- if (!xdr_mountres3_ok(xdrs, &objp->mountres3_u.mountinfo))
- return FALSE;
- break;
- default:
- break;
- }
+ if (objp->fhs_status == MNT_OK)
+ return xdr_mountres3_ok(xdrs, &objp->mountres3_u.mountinfo);
return TRUE;
}