X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=6f3a02d2619eeef095684fc927399fca7a9404dd;hp=2f20ffb5d1d97fb585803d1721bdfeb7e494ffb9;hb=5c635c724d60fe8e8bfeb00907dfa1e113cc3548;hpb=0c89d7959f4af7a2b39e925b2e8dc3a8954ccfa5 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);