https://bugs.winehq.org/show_bug.cgi?id=56837
--- Comment #9 from sldev sldev@free.fr --- (In reply to Piotr Caban from comment #8)
I have created MR that should fix the bug: https://gitlab.winehq.org/wine/wine/-/merge_requests/7651
It's based on Dmitry's patch but moves seek to _flsbuf function.
Err, no, this is not a correct fix for the issue at hand. The problem was that the write happened at the start of the file instead of at the end, while the file was opened in append mode (with no lseek() call used at all: see the bug-demo sources).
The suggested patch ( https://bugs.winehq.org/attachment.cgi?id=78274 ) is exactly what we need and what restores the normal behaviour of fwrite() in append mode.
Instead, https://gitlab.winehq.org/wine/wine/-/merge_requests/7651 addresses only an issue with _lseek(), which won't fix our issue.