diff options
author | marcel <marcel@FreeBSD.org> | 2009-05-30 19:23:09 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-05-30 19:23:09 +0000 |
commit | 8dccb90bbb1227d4b7ebf31ed2dfae3fec861745 (patch) | |
tree | b0066aba55afd06b0fa55431debdb61045722749 /lib/libstand/rpc.c | |
parent | 30dba4157fd4e14bd76a371789fdabd94da83190 (diff) | |
download | FreeBSD-src-8dccb90bbb1227d4b7ebf31ed2dfae3fec861745.zip FreeBSD-src-8dccb90bbb1227d4b7ebf31ed2dfae3fec861745.tar.gz |
Print the returned port number when RPC_DEBUG is defined.
This improves debugging.
Diffstat (limited to 'lib/libstand/rpc.c')
-rw-r--r-- | lib/libstand/rpc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/libstand/rpc.c b/lib/libstand/rpc.c index b48c574..49ddb9d 100644 --- a/lib/libstand/rpc.c +++ b/lib/libstand/rpc.c @@ -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); } |