From 6ee257dc5f184b855e3e557a54e818fa174e9aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Feb 2017 08:14:20 +0200 Subject: [PATCH] Only log an error if the binlog file exists The avrorouter logged an error every time it tried to open a file even if the file doesn't exist. --- server/modules/routing/avro/avro_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/avro/avro_file.c b/server/modules/routing/avro/avro_file.c index a16f05665..c1d65b1b0 100644 --- a/server/modules/routing/avro/avro_file.c +++ b/server/modules/routing/avro/avro_file.c @@ -67,7 +67,12 @@ bool avro_open_binlog(const char *binlogdir, const char *file, int *dest) if ((fd = open(path, O_RDONLY)) == -1) { - MXS_ERROR("Failed to open binlog file %s.", path); + if (errno != ENOENT) + { + char err[STRERROR_BUFLEN]; + MXS_ERROR("Failed to open binlog file %s: %d, %s", path, errno, + strerror_r(errno, err, sizeof(err))); + } return false; }