summaryrefslogtreecommitdiff
path: root/utils/showmount
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-09-26 16:03:27 -0400
committerSteve Dickson <steved@redhat.com>2008-09-26 16:03:27 -0400
commit7de004227d2a95ac10a591a68f95057a242d8dc0 (patch)
tree884de09b5cf15188d37a9a2e338026a27d348ca1 /utils/showmount
parenta663cf4c59e9b4fa56d8ca976c582ccf929140d2 (diff)
downloadnfs-utils-7de004227d2a95ac10a591a68f95057a242d8dc0.tar.gz
showmount: destroy RPC client when finished
Clean up: call clnt_destroy() in the showmount command as needed to destroy the RPC client properly (and close the associated socket) before the program exits. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/showmount')
-rw-r--r--utils/showmount/showmount.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c
index 5e3e419..959229a 100644
--- a/utils/showmount/showmount.c
+++ b/utils/showmount/showmount.c
@@ -395,6 +395,7 @@ int main(int argc, char **argv)
total_timeout);
if (clnt_stat != RPC_SUCCESS) {
clnt_perror(mclient, "rpc mount export");
+ clnt_destroy(mclient);
exit(1);
}
if (headers)
@@ -418,6 +419,7 @@ int main(int argc, char **argv)
printf("\n");
exportlist = exportlist->ex_next;
}
+ clnt_destroy(mclient);
exit(0);
}
@@ -428,8 +430,10 @@ int main(int argc, char **argv)
total_timeout);
if (clnt_stat != RPC_SUCCESS) {
clnt_perror(mclient, "rpc mount dump");
+ clnt_destroy(mclient);
exit(1);
}
+ clnt_destroy(mclient);
n = 0;
for (list = dumplist; list; list = list->ml_next)