always destroy the rpc client in nfsping

This commit is contained in:
Doug MacEachern 2005-02-11 23:47:10 +00:00
parent c9287bfccc
commit d1a6e3e143
1 changed files with 4 additions and 4 deletions

View File

@ -435,7 +435,7 @@ int sigar_nfsping(char *host)
{ {
CLIENT *client; CLIENT *client;
struct sockaddr_in addr; struct sockaddr_in addr;
int sock; int sock, retval=1;
struct timeval timeout, interval; struct timeval timeout, interval;
unsigned short port = 0; unsigned short port = 0;
char buffer[1024]; char buffer[1024];
@ -463,11 +463,11 @@ int sigar_nfsping(char *host)
if (rpc_stat != RPC_SUCCESS) { if (rpc_stat != RPC_SUCCESS) {
clnt_perror(client, buffer); clnt_perror(client, buffer);
clnt_destroy(client); retval = 0;
return 0;
} }
clnt_destroy(client);
return 1; return retval;
} }
#endif #endif