From: David Goulet Date: Wed, 19 Dec 2012 22:54:25 +0000 (-0500) Subject: Fix: don't print EPIPE error which can happen X-Git-Tag: v2.1.0~13 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d7b75ec82e5affcfec20e4bc6b208648aa0f58ba;p=lttng-tools.git Fix: don't print EPIPE error which can happen Anytime a relayd is killed, writing on a closed fd is totally possible so the PERROR of an EPIPE error is useless as an error but we do print it as a dbg message now. Signed-off-by: David Goulet --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 61d6f2e79..e0a756a56 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1325,7 +1325,15 @@ static int write_relayd_metadata_id(int fd, ret = write(fd, (void *) &hdr, sizeof(hdr)); } while (ret < 0 && errno == EINTR); if (ret < 0) { - PERROR("write metadata stream id"); + /* + * 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 + * code path. + */ + if (errno != EPIPE) { + PERROR("write metadata stream id"); + } + DBG3("Consumer failed to write relayd metadata id (errno: %d)", errno); goto end; } DBG("Metadata stream id %" PRIu64 " with padding %lu written before data",