summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-04-11 00:21:16 +0000
committeriedowse <iedowse@FreeBSD.org>2001-04-11 00:21:16 +0000
commitd212e20c86e42279e24581c24033392cfad8426f (patch)
treef15099ba47170b1f9a4f641d60a951295121051c /sbin
parent686317c48cfb02185bb15d898dfb2b2d00619f09 (diff)
downloadFreeBSD-src-d212e20c86e42279e24581c24033392cfad8426f.zip
FreeBSD-src-d212e20c86e42279e24581c24033392cfad8426f.tar.gz
Fix a typo relating to the "-U" (force UDP for mount protocol)
option. When specified, make sure to use the correct netid for the getnetconfigent() call, and also in error messages.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_nfs/mount_nfs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 5abc4f2..a026c71 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -771,16 +771,17 @@ nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
}
/* The RPCPROG_MNT netid may be different. */
if (mnttcp_ok) {
+ netid_mnt = netid;
nconf_mnt = nconf;
} else {
netid_mnt = (ai->ai_family == AF_INET6) ? "udp6" : "udp";
- if ((nconf_mnt = getnetconfigent(netid)) == NULL) {
- snprintf(errbuf, sizeof errbuf, "%s: %s", netid,
+ if ((nconf_mnt = getnetconfigent(netid_mnt)) == NULL) {
+ snprintf(errbuf, sizeof errbuf, "%s: %s", netid_mnt,
nc_sperror());
return (TRYRET_LOCALERR);
}
}
-
+
tryagain:
if (trymntmode == V2) {
nfsvers = 2;
@@ -846,7 +847,7 @@ tryagain:
try.tv_usec = 0;
clp = clnt_tp_create(hostp, RPCPROG_MNT, mntvers, nconf_mnt);
if (clp == NULL) {
- snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
+ snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
hostp, spec, clnt_spcreateerror("RPCMNT: clnt_create"));
return (returncode(rpc_createerr.cf_stat,
&rpc_createerr.cf_error));
@@ -867,7 +868,7 @@ tryagain:
goto tryagain;
}
clnt_geterr(clp, &rpcerr);
- snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
+ snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
hostp, spec, clnt_sperror(clp, "RPCPROG_MNT"));
clnt_destroy(clp);
return (returncode(stat, &rpcerr));
@@ -875,7 +876,7 @@ tryagain:
clnt_destroy(clp);
if (nfhret.stat != 0) {
- snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
+ snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
hostp, spec, strerror(nfhret.stat));
return (TRYRET_REMOTEERR);
}
OpenPOWER on IntegriCloud