From ec28fc7c4f3e136a38f361cf7ce2274452f0d849 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 6 Jan 2001 23:27:53 +0000 Subject: (Finding Tokens in a String): Document XPG basename() and dirname(), aswell as GNU basename(). --- sunrpc/pmap_clnt.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sunrpc') diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c index 05cfe2f..4db0f02 100644 --- a/sunrpc/pmap_clnt.c +++ b/sunrpc/pmap_clnt.c @@ -51,7 +51,7 @@ * interface. portmap caches interfaces, and on DHCP clients, * it could be that only loopback is started at this time. */ -static void +static bool_t __get_myaddress (struct sockaddr_in *addr) { int s; @@ -89,7 +89,7 @@ __get_myaddress (struct sockaddr_in *addr) *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); __close (s); - return; + return TRUE; } ifr++; } @@ -99,6 +99,7 @@ __get_myaddress (struct sockaddr_in *addr) goto again; } __close (s); + return FALSE; } @@ -118,7 +119,8 @@ pmap_set (u_long program, u_long version, int protocol, u_short port) struct pmap parms; bool_t rslt; - __get_myaddress (&myaddress); + if (!__get_myaddress (&myaddress)) + return FALSE; client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); if (client == (CLIENT *) NULL) @@ -152,7 +154,8 @@ pmap_unset (u_long program, u_long version) struct pmap parms; bool_t rslt; - __get_myaddress (&myaddress); + if (!__get_myaddress (&myaddress)) + return FALSE; client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); if (client == (CLIENT *) NULL) -- cgit v1.1