Fix TestLib::slurp_file() with offset on windows.
authorAndres Freund <[email protected]>
Mon, 4 Oct 2021 20:28:06 +0000 (13:28 -0700)
committerAndres Freund <[email protected]>
Mon, 4 Oct 2021 20:33:41 +0000 (13:33 -0700)
commit9e3be5c182d71d7575aa2e63d9604bfa715a432e
treecc594c1db42a03dd1156298ab1fdd76de0ecd4ab
parentb5f34ae08ad2153f66d2463ad008da9e67ec6b03
Fix TestLib::slurp_file() with offset on windows.

3c5b0685b921 used setFilePointer() to set the position of the filehandle, but
passed the wrong filehandle, always leaving the position at 0. Instead of just
fixing that, remove use of setFilePointer(), we have a perl fd at this point,
so we can just use perl's seek().

Additionally, the perl filehandle wasn't closed, just the windows filehandle.

Reviewed-By: Andrew Dunstan <[email protected]>
Author: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/20211003173038[email protected]
Backpatch: 9.6-, like 3c5b0685b921
src/test/perl/TestLib.pm