Use case-scope error labels handling LTTNG_CONSUMER_STREAMS_SENT
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 27 Aug 2019 20:37:26 +0000 (16:37 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Aug 2019 22:33:19 +0000 (18:33 -0400)
This cleans-up the error handling of the case handling the
LTTNG_CONSUMER_STREAMS_SENT 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 <jeremie.galarneau@efficios.com>
src/common/kernel-consumer/kernel-consumer.c

index d6fdb036a5e9b50ac97ba5fbd17c735776e252d1..95c92ba9b961d99821a80d21c339dc466af2924d 100644 (file)
@@ -827,7 +827,7 @@ error_add_stream_fatal:
                ret = consumer_send_status_msg(sock, ret_code);
                if (ret < 0 || ret_code != LTTCOMM_CONSUMERD_SUCCESS) {
                        /* Somehow, the session daemon is not responding anymore. */
-                       goto end_nosignal;
+                       goto error_streams_sent_nosignal;
                }
 
                health_code_update();
@@ -837,7 +837,7 @@ error_add_stream_fatal:
                 * streams in this channel.
                 */
                if (!channel->monitor) {
-                       break;
+                       goto end_error_streams_sent;
                }
 
                health_code_update();
@@ -846,11 +846,14 @@ error_add_stream_fatal:
                        ret = consumer_send_relayd_streams_sent(
                                        msg.u.sent_streams.net_seq_idx);
                        if (ret < 0) {
-                               goto end_nosignal;
+                               goto error_streams_sent_nosignal;
                        }
                        channel->streams_sent_to_relayd = true;
                }
+end_error_streams_sent:
                break;
+error_streams_sent_nosignal:
+               goto end_nosignal;
        }
        case LTTNG_CONSUMER_UPDATE_STREAM:
        {
This page took 0.026747 seconds and 4 git commands to generate.