BUG/MINOR: sink: make sure to always properly unmap a file-backed ring
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Jan 2023 11:11:41 +0000 (12:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 Jan 2023 11:11:41 +0000 (12:11 +0100)
commitfb9a4765b74cc18f25a6b732a66aae952262a7e0
tree86b99220be58a04fc8de5290e2db309158679519
parent0f29b34e0a06cdd59ae2278d33c16f63ca435468
BUG/MINOR: sink: make sure to always properly unmap a file-backed ring

The munmap() call performed on exit was incorrect since it used to apply
to the buffer instead of the area, so neither the pointer nor the size
were page-aligned. This patches corrects this and also adds a call to
msync() since munmap() alone doesn't guarantee that data will be dumped.

This should be backported to 2.6.
src/sink.c