X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=6f3a02d2619eeef095684fc927399fca7a9404dd;hb=05ec9ff7b0578958c5b83986aa38f2fa6edf57a7;hp=2f20ffb5d1d97fb585803d1721bdfeb7e494ffb9;hpb=9ce5646a7ef9b8d7936c46649a21ee546fadd538;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 2f20ffb5d..6f3a02d26 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -94,6 +94,18 @@ static void notify_thread_lttng_pipe(struct lttng_pipe *pipe) (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream)); } +static void notify_health_quit_pipe(int *pipe) +{ + int ret; + + do { + ret = write(pipe[1], "4", 1); + } while (ret < 0 && errno == EINTR); + if (ret < 0 || ret != 1) { + PERROR("write consumer health quit"); + } +} + static void notify_channel_pipe(struct lttng_consumer_local_data *ctx, struct lttng_consumer_channel *chan, uint64_t key, @@ -3121,6 +3133,8 @@ end: notify_channel_pipe(ctx, NULL, -1, CONSUMER_CHANNEL_QUIT); + notify_health_quit_pipe(health_quit_pipe); + /* Cleaning up possibly open sockets. */ if (sock >= 0) { ret = close(sock);