diff options
author | Ian Dowse <iedowse@FreeBSD.org> | 2001-04-11 00:21:16 +0000 |
---|---|---|
committer | Ian Dowse <iedowse@FreeBSD.org> | 2001-04-11 00:21:16 +0000 |
commit | ba33efd92c82082fd0a4b5f00ad71165cb279cdd (patch) | |
tree | a1e2889b9e89f92f6a9697684b5fcfe4cdebc1ad /sbin/mount_nfs | |
parent | 370d222b7fb948e76ad3f862c80875de0fb90985 (diff) | |
download | src-ba33efd92c82082fd0a4b5f00ad71165cb279cdd.tar.gz src-ba33efd92c82082fd0a4b5f00ad71165cb279cdd.zip |
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.
Notes
Notes:
svn path=/head/; revision=75401
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 5abc4f2cd3f9..a026c71f9a7c 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); } |