]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
showmount: destroy RPC client when finished
authorChuck Lever <chuck.lever@oracle.com>
Fri, 26 Sep 2008 20:03:27 +0000 (16:03 -0400)
committerSteve Dickson <steved@redhat.com>
Fri, 26 Sep 2008 20:03:27 +0000 (16:03 -0400)
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>
utils/showmount/showmount.c

index 5e3e419fa908dbea75421c53c3211f874dc3430d..959229a8c90bd59a3a61ee3bac6ce3ca0e38078a 100644 (file)
@@ -395,6 +395,7 @@ int main(int argc, char **argv)
                        total_timeout);
                if (clnt_stat != RPC_SUCCESS) {
                        clnt_perror(mclient, "rpc mount export");
                        total_timeout);
                if (clnt_stat != RPC_SUCCESS) {
                        clnt_perror(mclient, "rpc mount export");
+                       clnt_destroy(mclient);
                        exit(1);
                }
                if (headers)
                        exit(1);
                }
                if (headers)
@@ -418,6 +419,7 @@ int main(int argc, char **argv)
                        printf("\n");
                        exportlist = exportlist->ex_next;
                }
                        printf("\n");
                        exportlist = exportlist->ex_next;
                }
+               clnt_destroy(mclient);
                exit(0);
        }
 
                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");
                total_timeout);
        if (clnt_stat != RPC_SUCCESS) {
                clnt_perror(mclient, "rpc mount dump");
+               clnt_destroy(mclient);
                exit(1);
        }
                exit(1);
        }
+       clnt_destroy(mclient);
 
        n = 0;
        for (list = dumplist; list; list = list->ml_next)
 
        n = 0;
        for (list = dumplist; list; list = list->ml_next)