From 936b2f5c3f2df88c21c0961f35ed215adf02e17f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 8 Sep 2014 14:53:28 +0200 Subject: mds-registry: take care of danger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-registry/mds-registry.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/mds-registry/mds-registry.c') diff --git a/src/mds-registry/mds-registry.c b/src/mds-registry/mds-registry.c index f753f26..741423c 100644 --- a/src/mds-registry/mds-registry.c +++ b/src/mds-registry/mds-registry.c @@ -152,12 +152,19 @@ int postinitialise_server(void) */ int master_loop(void) { - int rc = 1; + int rc = 1, r; while (!reexecing && !terminating) { - int r = mds_message_read(&received, socket_fd); - if (r == 0) + if (danger) + { + danger = 0; + free(send_buffer), send_buffer = NULL; + send_buffer_size = 0; + with_mutex (slave_mutex, linked_list_pack(&slave_list);); + } + + if (r = mds_message_read(&received, socket_fd), r == 0) if (r = handle_message(), r == 0) continue; -- cgit v1.2.3-70-g09d2