projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't delete source file when decompressing to stdout
[oweals/busybox.git]
/
util-linux
/
nfsmount.c
diff --git
a/util-linux/nfsmount.c
b/util-linux/nfsmount.c
index ae44f3207bf356e64c633b3724694a4520db0739..cd722acc34f2c6eb895e429edc642dca45b3f84c 100644
(file)
--- a/
util-linux/nfsmount.c
+++ b/
util-linux/nfsmount.c
@@
-33,25
+33,25
@@
* nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
*/
* nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
*/
-#include "busybox.h"
-#undef FALSE
-#undef TRUE
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
-#include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/utsname.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/utsname.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-
-#include "nfsmount.h"
+#include <stdlib.h>
+#include "busybox.h"
+#undef TRUE
+#undef FALSE
+#include <rpc/rpc.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_clnt.h>
#include <linux/nfs.h> /* For the kernels nfs stuff */
#include <linux/nfs.h> /* For the kernels nfs stuff */
+#include "nfsmount.h"
#ifndef NFS_FHSIZE
static const int NFS_FHSIZE = 32;
#ifndef NFS_FHSIZE
static const int NFS_FHSIZE = 32;
@@
-157,7
+157,7
@@
static const int NFS_MOUNT_NONLM = 0x0200; /* 3 */
#define HAVE_personality
#define HAVE_tm_gmtoff
#define HAVE_personality
#define HAVE_tm_gmtoff
-static char *nfs_strerror(int stat);
+static char *nfs_strerror(int stat
us
);
#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
@@
-262,7
+262,7
@@
int nfsmount(const char *spec, const char *node, int *flags,
char hostdir[1024];
CLIENT *mclient;
char *hostname;
char hostdir[1024];
CLIENT *mclient;
char *hostname;
- char *
dir
name;
+ char *
path
name;
char *old_opts;
char *mounthost=NULL;
char new_opts[1024];
char *old_opts;
char *mounthost=NULL;
char new_opts[1024];
@@
-316,7
+316,7
@@
int nfsmount(const char *spec, const char *node, int *flags,
strcpy(hostdir, spec);
if ((s = strchr(hostdir, ':'))) {
hostname = hostdir;
strcpy(hostdir, spec);
if ((s = strchr(hostdir, ':'))) {
hostname = hostdir;
-
dir
name = s + 1;
+
path
name = s + 1;
*s = '\0';
/* Ignore all but first hostname in replicated mounts
until they can be fully supported. (mack@sgi.com) */
*s = '\0';
/* Ignore all but first hostname in replicated mounts
until they can be fully supported. (mack@sgi.com) */
@@
-335,7
+335,7
@@
int nfsmount(const char *spec, const char *node, int *flags,
#endif
{
if ((hp = gethostbyname(hostname)) == NULL) {
#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)) {
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
@@
-580,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) {
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)) {
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
@@
-662,7
+662,7
@@
int nfsmount(const char *spec, const char *node, int *flags,
mclient = 0;
}
if (mclient) {
mclient = 0;
}
if (mclient) {
- /* try to mount hostname:
dir
name */
+ /* try to mount hostname:
path
name */
mclient->cl_auth = authunix_create_default();
/* make pointers in xdr_mountres3 NULL so
mclient->cl_auth = authunix_create_default();
/* make pointers in xdr_mountres3 NULL so
@@
-673,14
+673,14
@@
int nfsmount(const char *spec, const char *node, int *flags,
if (pm_mnt->pm_vers == 3)
clnt_stat = clnt_call(mclient, MOUNTPROC3_MNT,
(xdrproc_t) xdr_dirpath,
if (pm_mnt->pm_vers == 3)
clnt_stat = clnt_call(mclient, MOUNTPROC3_MNT,
(xdrproc_t) xdr_dirpath,
- (caddr_t) &
dir
name,
+ (caddr_t) &
path
name,
(xdrproc_t) xdr_mountres3,
(caddr_t) &status,
total_timeout);
else
clnt_stat = clnt_call(mclient, MOUNTPROC_MNT,
(xdrproc_t) xdr_dirpath,
(xdrproc_t) xdr_mountres3,
(caddr_t) &status,
total_timeout);
else
clnt_stat = clnt_call(mclient, MOUNTPROC_MNT,
(xdrproc_t) xdr_dirpath,
- (caddr_t) &
dir
name,
+ (caddr_t) &
path
name,
(xdrproc_t) xdr_fhstatus,
(caddr_t) &status,
total_timeout);
(xdrproc_t) xdr_fhstatus,
(caddr_t) &status,
total_timeout);
@@
-720,7
+720,7
@@
int nfsmount(const char *spec, const char *node, int *flags,
if (nfsvers == 2) {
if (status.nfsv2.fhs_status != 0) {
error_msg("%s:%s failed, reason given by server: %s",
if (nfsvers == 2) {
if (status.nfsv2.fhs_status != 0) {
error_msg("%s:%s failed, reason given by server: %s",
- hostname,
dir
name,
+ hostname,
path
name,
nfs_strerror(status.nfsv2.fhs_status));
goto fail;
}
nfs_strerror(status.nfsv2.fhs_status));
goto fail;
}
@@
-735,20
+735,20
@@
int nfsmount(const char *spec, const char *node, int *flags,
#endif
} else {
#if NFS_MOUNT_VERSION >= 4
#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",
if (status.nfsv3.fhs_status != 0) {
error_msg("%s:%s failed, reason given by server: %s",
- hostname,
dir
name,
+ hostname,
path
name,
nfs_strerror(status.nfsv3.fhs_status));
goto fail;
}
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));
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,
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
data.flags |= NFS_MOUNT_VER3;
#endif
@@
-873,20
+873,20
@@
static struct {
{ -1, EIO }
};
{ -1, EIO }
};
-static char *nfs_strerror(int stat)
+static char *nfs_strerror(int stat
us
)
{
int i;
static char buf[256];
for (i = 0; nfs_errtbl[i].stat != -1; i++) {
{
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 == stat
us
)
return strerror(nfs_errtbl[i].errnum);
}
return strerror(nfs_errtbl[i].errnum);
}
- sprintf(buf, _("unknown nfs status return value: %d"), stat);
+ sprintf(buf, _("unknown nfs status return value: %d"), stat
us
);
return buf;
}
return buf;
}
-bool_t
+
static
bool_t
xdr_fhandle (XDR *xdrs, fhandle objp)
{
//register int32_t *buf;
xdr_fhandle (XDR *xdrs, fhandle objp)
{
//register int32_t *buf;