mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 20:47:18 +02:00
Fix pg_verify_checksums on Windows.
To verify the checksums, we open the file in text mode which doesn't work on Windows as WIN32 treats Control-Z as EOF in files opened in text mode. This leads to "short read of block .." error in some cases. Fix it by opening the files in the binary mode. Author: Amit Kapila Reviewed-by: Magnus Hagander Backpatch-through: 11 Discussion: https://postgr.es/m/CAA4eK1+LOnzod+h85FGmyjWzXKy-XV1FYwEyP-Tky2WpD5cxwA@mail.gmail.com
This commit is contained in:
parent
40e9813913
commit
762a16572b
@ -83,7 +83,7 @@ scan_file(char *fn, int segmentno)
|
|||||||
int f;
|
int f;
|
||||||
int blockno;
|
int blockno;
|
||||||
|
|
||||||
f = open(fn, 0);
|
f = open(fn, O_RDONLY | PG_BINARY);
|
||||||
if (f < 0)
|
if (f < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
|
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
|
||||||
|
Loading…
Reference in New Issue
Block a user