+
+static void close_stat_client(struct stat_client *sc)
+{
+ PARA_INFO_LOG("closing client fd %d\n", sc->fd);
+ close(sc->fd);
+ list_del(&sc->node);
+ free(sc);
+ num_clients--;
+}
+
+/**
+ * Empty the status clients list.
+ *
+ * This iterates over the list of connected status clients, closes each client
+ * file descriptor and frees the resources.
+ */
+void close_stat_clients(void)
+{
+ struct stat_client *sc, *tmp;
+
+ list_for_each_entry_safe(sc, tmp, &client_list, node)
+ close_stat_client(sc);
+ assert(num_clients == 0);
+}
+