When binding to transports if getnetconfigent() fails then actually

print out the correct transport it failed on rather than always
spitting out 'udp', also call nc_sperror() to give a more verbose
error message detailing the problem.
This commit is contained in:
Alfred Perlstein 2002-04-11 07:19:30 +00:00
parent 17dfcdfaed
commit 5ed43a1e8e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94404

View File

@ -142,7 +142,8 @@ main(argc, argv)
for (i = 0; i < maxindex; i++) {
nconf = getnetconfigent(transports[i]);
if (nconf == NULL)
errx(1, "cannot get udp netconf.");
errx(1, "cannot get %s netconf: %s.", transports[i],
nc_sperror());
transp = svc_tli_create(RPC_ANYFD, nconf, NULL, 0, 0);
if (transp == NULL) {