From a8ffe2444f26010961b3b5c171775205f1a43a18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 27 Aug 2019 17:01:16 -0400 Subject: [PATCH] Use case-scope error labels handling LTTNG_CONSUMER_PUSH_METADATA MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This cleans-up the error handling of the case handling the LTTNG_CONSUMER_PUSH_METADATA command. This is done in order to allow a follow-up commit to perform some common clean-up operations on error while introducing as few changes as possible. No behaviour change is intended. Signed-off-by: Jérémie Galarneau --- src/common/ust-consumer/ust-consumer.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index b2c454deb..ee6f4f79b 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1712,7 +1712,7 @@ end_get_channel_nosignal: */ DBG("UST consumer push metadata %" PRIu64 " not found", key); ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL; - goto end_msg_sessiond; + goto end_push_metadata_msg_sessiond; } health_code_update(); @@ -1723,14 +1723,14 @@ end_get_channel_nosignal: * checked whether the channel can be found. */ ret_code = LTTCOMM_CONSUMERD_SUCCESS; - goto end_msg_sessiond; + goto end_push_metadata_msg_sessiond; } /* Tell session daemon we are ready to receive the metadata. */ ret = consumer_send_status_msg(sock, LTTCOMM_CONSUMERD_SUCCESS); if (ret < 0) { /* Somehow, the session daemon is not responding anymore. */ - goto error_fatal; + goto error_push_metadata_fatal; } health_code_update(); @@ -1740,7 +1740,7 @@ end_get_channel_nosignal: ret = lttng_consumer_poll_socket(consumer_sockpoll); health_poll_exit(); if (ret) { - goto error_fatal; + goto error_push_metadata_fatal; } health_code_update(); @@ -1749,11 +1749,15 @@ end_get_channel_nosignal: len, version, channel, 0, 1); if (ret < 0) { /* error receiving from sessiond */ - goto error_fatal; + goto error_push_metadata_fatal; } else { ret_code = ret; - goto end_msg_sessiond; + goto end_push_metadata_msg_sessiond; } +end_push_metadata_msg_sessiond: + goto end_msg_sessiond; +error_push_metadata_fatal: + goto error_fatal; } case LTTNG_CONSUMER_SETUP_METADATA: { -- 2.34.1