Fixed formatting and added more error checks
Added log messages when ftruncate fails and cleaned up formatting.
This commit is contained in:
@ -338,8 +338,14 @@ int n;
|
|||||||
router->service->name, router->last_written,
|
router->service->name, router->last_written,
|
||||||
router->binlog_name,
|
router->binlog_name,
|
||||||
strerror_r(errno, err_msg, sizeof(err_msg)));
|
strerror_r(errno, err_msg, sizeof(err_msg)));
|
||||||
/* Remove any partual event that was written */
|
/* Remove any partial event that was written */
|
||||||
ftruncate(router->binlog_fd, router->last_written);
|
if (ftruncate(router->binlog_fd, router->last_written))
|
||||||
|
{
|
||||||
|
MXS_ERROR("%s: Failed to truncate binlog record at %lu of %s, %s. ",
|
||||||
|
router->service->name, router->last_written,
|
||||||
|
router->binlog_name,
|
||||||
|
strerror_r(errno, err_msg, sizeof(err_msg)));
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
spinlock_acquire(&router->binlog_lock);
|
spinlock_acquire(&router->binlog_lock);
|
||||||
|
@ -2388,7 +2388,7 @@ int n;
|
|||||||
strerror_r(errno, err_msg, sizeof(err_msg)));
|
strerror_r(errno, err_msg, sizeof(err_msg)));
|
||||||
|
|
||||||
/* Remove any partial event that was written */
|
/* Remove any partial event that was written */
|
||||||
if(ftruncate(router->binlog_fd, router->last_written))
|
if (ftruncate(router->binlog_fd, router->last_written))
|
||||||
{
|
{
|
||||||
MXS_ERROR("%s: Failed to truncate binlog record at %lu of %s, %s. ",
|
MXS_ERROR("%s: Failed to truncate binlog record at %lu of %s, %s. ",
|
||||||
router->service->name, router->last_written,
|
router->service->name, router->last_written,
|
||||||
|
Reference in New Issue
Block a user