Print the returned port number when RPC_DEBUG is defined.

This improves debugging.
This commit is contained in:
Marcel Moolenaar 2009-05-30 19:23:09 +00:00
parent 56e13f2ac1
commit 2ab2a8354e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193109

View File

@ -405,17 +405,19 @@ rpc_getport(d, prog, vers)
#ifdef RPC_DEBUG
if (debug)
printf("getport: prog=0x%x vers=%d\n", prog, vers);
printf("%s: prog=0x%x vers=%d\n", __func__, prog, vers);
#endif
/* This one is fixed forever. */
if (prog == PMAPPROG)
return (PMAPPORT);
if (prog == PMAPPROG) {
port = PMAPPORT;
goto out;
}
/* Try for cached answer first */
port = rpc_pmap_getcache(d->destip, prog, vers);
if (port != -1)
return (port);
goto out;
args = &sdata.d;
args->prog = htonl(prog);
@ -435,5 +437,10 @@ rpc_getport(d, prog, vers)
rpc_pmap_putcache(d->destip, prog, vers, port);
out:
#ifdef RPC_DEBUG
if (debug)
printf("%s: port=%u\n", __func__, port);
#endif
return (port);
}