Fix: don't send error to sessiond on orderly shutdown
authorDavid Goulet <dgoulet@efficios.com>
Thu, 4 Jul 2013 20:31:27 +0000 (16:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Jul 2013 21:38:49 +0000 (17:38 -0400)
The send always fail if the sessiond has closed the socket so no point
of trying to send an error.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/kernel-consumer/kernel-consumer.c
src/common/ust-consumer/ust-consumer.c

index f615067232a551679172152160c1d42dd765592b..5712144f7a8253cc691c64196e6be5da4ee3030c 100644 (file)
@@ -97,8 +97,8 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 
        ret = lttcomm_recv_unix_sock(sock, &msg, sizeof(msg));
        if (ret != sizeof(msg)) {
-               lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_CMD);
                if (ret > 0) {
+                       lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_CMD);
                        ret = -1;
                }
                return ret;
index 290eb3390e80aff424d954f8d9b7a00746f62fc0..9550ef424d93877acac1e8e33411739b2c820b5c 100644 (file)
@@ -824,12 +824,12 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
        if (ret != sizeof(msg)) {
                DBG("Consumer received unexpected message size %zd (expects %zu)",
                        ret, sizeof(msg));
-               lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_CMD);
                /*
                 * The ret value might 0 meaning an orderly shutdown but this is ok
                 * since the caller handles this.
                 */
                if (ret > 0) {
+                       lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_CMD);
                        ret = -1;
                }
                return ret;
This page took 0.028086 seconds and 4 git commands to generate.