From ba33efd92c82082fd0a4b5f00ad71165cb279cdd Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Wed, 11 Apr 2001 00:21:16 +0000 Subject: 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. --- sbin/mount_nfs/mount_nfs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sbin') 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); } -- cgit v1.2.3