/[Apache-SVN]
ViewVC logotype

Revision 1909088


Jump to revision: Previous Next
Author: kotkov
Date: Wed Apr 12 12:51:03 2023 UTC (12 months, 3 weeks ago)
Changed paths: 3
Log Message:
Revert r1808456 (Win32: Don't seek to the end when opening files with
APR_FOPEN_APPEND).

While this change fixed an issue where Windows and Unix reported different
offsets after opening files for append, it also caused a regression: for
files opened with APR_FOPEN_APPEND | APR_FOPEN_BUFFERED, flushing their
contents would cause the contents to be written at offset 0, rather than
appended.

This happens because flushes and regular writes use different code paths.
And while regular writes guarantee that an append will happen to the end of
the file, a buffer flush uses a regular WriteFile(), assuming the file pointer
has been properly set before.

To fix both issues, we'd probably need to rework this part and make all
writes use the same approach.  But for now let's revert this change to fix
the regression, that was also reported in [1].

I'll add a regression test for this problem separately.

[1] https://lists.apache.org/thread/56gnyc3tc0orjh5mfsqo9gpq1br59b01

Changed paths

Path Details
Directoryapr/apr/trunk/CHANGES modified , text changed
Directoryapr/apr/trunk/file_io/win32/open.c modified , text changed
Directoryapr/apr/trunk/test/testfile.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26