X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=1045bfb46101d8a6bb63a8c91157f3ffbf5199a2;hb=534d2592c0566f7c07cd9e9f9385781a65566e16;hp=63c98350a4772435b50a84ae4b0ac25f4e4f3455;hpb=59e71485e5ee0f88fd3a19c25c6eea842e118d37;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 63c98350a..1045bfb46 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1334,6 +1334,12 @@ static int write_relayd_metadata_id(int fd, PERROR("write metadata stream id"); } DBG3("Consumer failed to write relayd metadata id (errno: %d)", errno); + /* + * Set ret to a negative value because if ret != sizeof(hdr), we don't + * handle writting the missing part so report that as an error and + * don't lie to the caller. + */ + ret = -1; goto end; } DBG("Metadata stream id %" PRIu64 " with padding %lu written before data", @@ -2597,7 +2603,7 @@ void *consumer_thread_sessiond_poll(void *data) /* Blocking call, waiting for transmission */ sock = lttcomm_accept_unix_sock(client_socket); - if (sock <= 0) { + if (sock < 0) { WARN("On accept"); goto end; }