Fix compiler warnings

Added missing checks for return values of various function calls. Fixed
binlogrouter strerror_r usage and wrong buffer sizes.
This commit is contained in:
Markus Mäkelä
2017-02-13 11:41:58 +02:00
parent eb1e163bdf
commit acd66b4eb3
7 changed files with 78 additions and 27 deletions

View File

@ -3556,7 +3556,12 @@ blr_start_slave(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
router->prevbinlog,
router->last_safe_pos);
/* Truncate previous binlog file to last_safe pos */
truncate(file, router->last_safe_pos);
if (truncate(file, router->last_safe_pos) == -1)
{
char err[MXS_STRERROR_BUFLEN];
MXS_ERROR("Failed to truncate file: %d, %s",
errno, strerror_r(errno, err, sizeof(err)));
}
/* Log it */
MXS_WARNING("A transaction is still opened at pos %lu"