The connect_nb() routne returns zero for success and a negative
value for failure which was not being interpreted correctly
by the getport() routine. This patch fixes that problem.
Signed-off-by: Steve Dickson <steved@redhat.com>
*
* tout contains the timeout. It will be modified to contain the time
* remaining (i.e. time provided - time elasped).
*
* tout contains the timeout. It will be modified to contain the time
* remaining (i.e. time provided - time elasped).
+ *
+ * Returns 0 for success
*/
static int connect_nb(int fd, struct sockaddr_in *addr, struct timeval *tout)
{
*/
static int connect_nb(int fd, struct sockaddr_in *addr, struct timeval *tout)
{
tout.tv_sec = TIMEOUT_TCP;
ret = connect_nb(sock, &saddr, &tout);
tout.tv_sec = TIMEOUT_TCP;
ret = connect_nb(sock, &saddr, &tout);
close(sock);
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
close(sock);
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
MOUNTPROG, MOUNTVERS, IPPROTO_TCP);
if (server_addr.sin_port) {
ret = connect_nb(msock, &server_addr, 0);
MOUNTPROG, MOUNTVERS, IPPROTO_TCP);
if (server_addr.sin_port) {
ret = connect_nb(msock, &server_addr, 0);
+ if (ret == 0) /* success */
mclient = clnttcp_create(&server_addr,
MOUNTPROG, MOUNTVERS, &msock,
0, 0);
mclient = clnttcp_create(&server_addr,
MOUNTPROG, MOUNTVERS, &msock,
0, 0);