Checkout
stefan2
committed
on 03 Sep 16
Add a workaround for yet another issue with APR's apr_file_trunc.

The previous workaround is ineffective if the last file access had been
a… Show more
Add a workaround for yet another issue with APR's apr_file_trunc.

The previous workaround is ineffective if the last file access had been

a read.  Now, we force it into to "write mode" internally to have the

existing workaround kick in.

Luckily, this only affects 'svnadmin pack' for FSFS format 7 and FSX.

The other functions using trunc should have no problem with the added

overhead.

* subversion/libsvn_subr/io.c

 (svn_io_file_trunc): Admend the existing workaround with a dummy-write.

* subversion/tests/libsvn_subr/io-test.c

 (test_apr_trunc_workaround): New test demonstrating the problem.

 (test_funcs): Register the new test. Show less