X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=1e710ab3d9b80fefbbfe2aad58fd050e50d03444;hp=e0a756a5697c40c7cbbd1ff0887a5c01f61464e3;hb=4cec016f4a1cb76ec3d917c2d261c4081910a65a;hpb=a6cd2b97ca69d302670109fef8340bd927270a30 diff --git a/src/common/consumer.c b/src/common/consumer.c index e0a756a56..1e710ab3d 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1106,7 +1106,7 @@ void lttng_consumer_should_exit(struct lttng_consumer_local_data *ctx) do { ret = write(ctx->consumer_should_quit[1], "4", 1); } while (ret < 0 && errno == EINTR); - if (ret < 0) { + if (ret < 0 || ret != 1) { PERROR("write consumer quit"); } @@ -1324,7 +1324,7 @@ static int write_relayd_metadata_id(int fd, do { ret = write(fd, (void *) &hdr, sizeof(hdr)); } while (ret < 0 && errno == EINTR); - if (ret < 0) { + if (ret < 0 || ret != sizeof(hdr)) { /* * This error means that the fd's end is closed so ignore the perror * not to clubber the error output since this can happen in a normal