Correctly calculate ftruncate size.
commit568f3daf125560ac1257550dfc50bc56565b019f
authorKeith Rarick <kr@xph.us>
Sat, 28 Nov 2009 01:33:30 +0000 (27 17:33 -0800)
committerKeith Rarick <kr@xph.us>
Sat, 28 Nov 2009 01:41:14 +0000 (27 17:41 -0800)
treec2e6b71fdbe78b75ac7c49cec15acc6bdf3d24d4
parent644b1d04dc520507eea3012165ee61ae92fb96b8
Correctly calculate ftruncate size.

The file might be slightly bigger than binlog_size_limit, but the number
of bytes written should always be binlog_size_limit - b->free -
b->reserved. And b->reserved should be zero for a binlog ready to be
closed. (Also, the offset argument to lseek should have been negated.)

Also test for truncated binlog files.
binlog.c
sh-tests/binlog-sizelimit.sh