X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=inline;f=nfsmount.c;h=90cf9fb1bb979a54ff46977296917c62a6102a75;hb=004015e9c4e8ff98bcbaf955cf42147218204da4;hp=fff02d31249635d47b92ca9da62d806be1db6146;hpb=3f5bcbfa3cee92cbc1995d1e71739c47ac5ba456;p=oweals%2Fbusybox.git diff --git a/nfsmount.c b/nfsmount.c index fff02d312..90cf9fb1b 100644 --- a/nfsmount.c +++ b/nfsmount.c @@ -33,26 +33,25 @@ * nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp */ -#include "busybox.h" -#undef FALSE -#undef TRUE #include #include #include #include #include -#include -#include -#include #include #include -//#include #include #include #include - -#include "nfsmount.h" +#include +#include "busybox.h" +#undef TRUE +#undef FALSE +#include +#include +#include #include /* For the kernels nfs stuff */ +#include "nfsmount.h" #ifndef NFS_FHSIZE static const int NFS_FHSIZE = 32; @@ -158,7 +157,7 @@ static const int NFS_MOUNT_NONLM = 0x0200; /* 3 */ #define HAVE_personality #define HAVE_tm_gmtoff -static char *nfs_strerror(int stat); +static char *nfs_strerror(int status); #define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r)) #define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2) @@ -336,7 +335,7 @@ int nfsmount(const char *spec, const char *node, int *flags, #endif { if ((hp = gethostbyname(hostname)) == NULL) { - error_msg("can't get address for %s", hostname); + herror_msg("%s", hostname); goto fail; } else { if (hp->h_length > sizeof(struct in_addr)) { @@ -581,7 +580,7 @@ int nfsmount(const char *spec, const char *node, int *flags, mount_server_addr.sin_addr.s_addr = inet_addr(hostname); } else { if ((hp = gethostbyname(mounthost)) == NULL) { - error_msg("can't get address for %s", hostname); + herror_msg("%s", mounthost); goto fail; } else { if (hp->h_length > sizeof(struct in_addr)) { @@ -736,20 +735,20 @@ int nfsmount(const char *spec, const char *node, int *flags, #endif } else { #if NFS_MOUNT_VERSION >= 4 - fhandle3 *fhandle; + fhandle3 *my_fhandle; if (status.nfsv3.fhs_status != 0) { error_msg("%s:%s failed, reason given by server: %s", hostname, dirname, nfs_strerror(status.nfsv3.fhs_status)); goto fail; } - fhandle = &status.nfsv3.mountres3_u.mountinfo.fhandle; + my_fhandle = &status.nfsv3.mountres3_u.mountinfo.fhandle; memset(data.old_root.data, 0, NFS_FHSIZE); memset(&data.root, 0, sizeof(data.root)); - data.root.size = fhandle->fhandle3_len; + data.root.size = my_fhandle->fhandle3_len; memcpy(data.root.data, - (char *) fhandle->fhandle3_val, - fhandle->fhandle3_len); + (char *) my_fhandle->fhandle3_val, + my_fhandle->fhandle3_len); data.flags |= NFS_MOUNT_VER3; #endif @@ -874,20 +873,20 @@ static struct { { -1, EIO } }; -static char *nfs_strerror(int stat) +static char *nfs_strerror(int status) { int i; static char buf[256]; for (i = 0; nfs_errtbl[i].stat != -1; i++) { - if (nfs_errtbl[i].stat == stat) + if (nfs_errtbl[i].stat == status) return strerror(nfs_errtbl[i].errnum); } - sprintf(buf, _("unknown nfs status return value: %d"), stat); + sprintf(buf, _("unknown nfs status return value: %d"), status); return buf; } -bool_t +static bool_t xdr_fhandle (XDR *xdrs, fhandle objp) { //register int32_t *buf;