Fixed formatting and added more error checks
Added log messages when ftruncate fails and cleaned up formatting.
This commit is contained in:
parent
cd2af6ffef
commit
63ce9fe6bc
@ -338,8 +338,14 @@ int n;
|
||||
router->service->name, router->last_written,
|
||||
router->binlog_name,
|
||||
strerror_r(errno, err_msg, sizeof(err_msg)));
|
||||
/* Remove any partual event that was written */
|
||||
ftruncate(router->binlog_fd, router->last_written);
|
||||
/* Remove any partial event that was 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;
|
||||
}
|
||||
spinlock_acquire(&router->binlog_lock);
|
||||
|
@ -2388,7 +2388,7 @@ int n;
|
||||
strerror_r(errno, err_msg, sizeof(err_msg)));
|
||||
|
||||
/* 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. ",
|
||||
router->service->name, router->last_written,
|
||||
|
Loading…
x
Reference in New Issue
Block a user