X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fshowmount%2Fshowmount.c;h=f3ac671c9308f08df356226c6fda10596db6eccd;hp=9979621e3c3a26d4cbcd2e994cfb3c71b0a8ece2;hb=1bcf67703e5606837853666763c739db91f08fee;hpb=a68d983fb3b571720eb94f68d56e8849583a2a21 diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c index 9979621..f3ac671 100644 --- a/utils/showmount/showmount.c +++ b/utils/showmount/showmount.c @@ -118,7 +118,7 @@ static int connect_nb(int fd, struct sockaddr_in *addr, struct timeval *tout) FD_ZERO(&rset); FD_SET(fd, &rset); - ret = select(fd + 1, &rset, NULL, NULL, tout); + ret = select(fd + 1, NULL, &rset, NULL, tout); if (ret <= 0) { if (ret == 0) ret = -ETIMEDOUT; @@ -185,6 +185,9 @@ static unsigned short getport(struct sockaddr_in *addr, rpc_createerr.cf_error.re_errno = errno; return 0; } + client = clnttcp_create(&saddr, + PMAPPROG, PMAPVERS, &sock, + 0, 0); } else { /* * bind to any unused port. If we left this up to the rpc @@ -213,10 +216,10 @@ static unsigned short getport(struct sockaddr_in *addr, sock = RPC_ANYSOCK; /* FALLTHROUGH */ } + client = clntudp_bufcreate(&saddr, PMAPPROG, PMAPVERS, + tout, &sock, send_sz, recv_sz); } - client = clntudp_bufcreate(&saddr, PMAPPROG, PMAPVERS, - tout, &sock, send_sz, recv_sz); if (!client) { close(sock); rpc_createerr.cf_stat = RPC_RPCBFAILURE;