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.
This commit is contained in:
Markus Mäkelä 2017-02-03 08:14:20 +02:00
parent eb5e284a90
commit 6ee257dc5f

View File

@ -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;
}