From d7e694ad7049cd819f8dbc26ec1e7d35b4d1a6fe Mon Sep 17 00:00:00 2001 From: Pranith K Date: Tue, 28 Sep 2010 09:27:23 +0000 Subject: mgmt/glusterd: prevent cleanup_and_exit if its already started Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1706 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1706 --- glusterfsd/src/glusterfsd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index f1cd0270735..332f8f3a740 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -654,9 +654,15 @@ cleanup_and_exit (int signum) ctx = glusterfs_ctx_get (); /* TODO: is this the right place? */ + if (!ctx) + return; + if (ctx->cleanup_started) + return; + + ctx->cleanup_started = 1; glusterfs_mgmt_pmap_signout (ctx); - if (ctx && ctx->mgmt) + if (ctx->mgmt) rpc_clnt_destroy (ctx->mgmt); gf_log ("glusterfsd", GF_LOG_NORMAL, "shutting down"); -- cgit