From d1a6e3e143e676db795741fd89859343339d4aa9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 11 Feb 2005 23:47:10 +0000 Subject: [PATCH] always destroy the rpc client in nfsping --- src/sigar_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sigar_util.c b/src/sigar_util.c index 742f6bbc..0688bf98 100644 --- a/src/sigar_util.c +++ b/src/sigar_util.c @@ -435,7 +435,7 @@ int sigar_nfsping(char *host) { CLIENT *client; struct sockaddr_in addr; - int sock; + int sock, retval=1; struct timeval timeout, interval; unsigned short port = 0; char buffer[1024]; @@ -463,11 +463,11 @@ int sigar_nfsping(char *host) if (rpc_stat != RPC_SUCCESS) { clnt_perror(client, buffer); - clnt_destroy(client); - return 0; + retval = 0; } + clnt_destroy(client); - return 1; + return retval; } #endif