From 3ca1c9c2b65337af5c2c18fcdf3e831d91085f8f Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 1 May 2012 06:58:07 +0930 Subject: [PATCH] only close client socket if it has already been opened. --- overlay_mdp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/overlay_mdp.c b/overlay_mdp.c index 387cb745..15d3413f 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -1171,10 +1171,12 @@ int overlay_mdp_client_init() int overlay_mdp_client_done() { - /* Tell MDP server to release all our bindings */ - overlay_mdp_frame mdp; - mdp.packetTypeAndFlags=MDP_GOODBYE; - overlay_mdp_send(&mdp,0,0); + if (mdp_client_socket!=-1) { + /* Tell MDP server to release all our bindings */ + overlay_mdp_frame mdp; + mdp.packetTypeAndFlags=MDP_GOODBYE; + overlay_mdp_send(&mdp,0,0); + } if (overlay_mdp_client_socket_path_len>-1) unlink(overlay_mdp_client_socket_path);