@@ -865,7 +865,7 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
865
865
#endif
866
866
867
867
/* open file for read */
868
- in = fopen (from_path , "r " );
868
+ in = fopen (from_path , "rb " );
869
869
if (in == NULL )
870
870
elog (ERROR , "Cannot open source WAL file \"%s\": %s" , from_path ,
871
871
strerror (errno ));
@@ -896,7 +896,7 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
896
896
897
897
snprintf (to_path_temp , sizeof (to_path_temp ), "%s.partial" , to_path );
898
898
899
- out = fopen (to_path_temp , "w " );
899
+ out = fopen (to_path_temp , "wb " );
900
900
if (out == NULL )
901
901
elog (ERROR , "Cannot open destination WAL file \"%s\": %s" ,
902
902
to_path_temp , strerror (errno ));
@@ -1018,7 +1018,7 @@ get_wal_file(const char *from_path, const char *to_path)
1018
1018
#endif
1019
1019
1020
1020
/* open file for read */
1021
- in = fopen (from_path , "r " );
1021
+ in = fopen (from_path , "rb " );
1022
1022
if (in == NULL )
1023
1023
{
1024
1024
#ifdef HAVE_LIBZ
@@ -1055,7 +1055,7 @@ get_wal_file(const char *from_path, const char *to_path)
1055
1055
/* open backup file for write */
1056
1056
snprintf (to_path_temp , sizeof (to_path_temp ), "%s.partial" , to_path );
1057
1057
1058
- out = fopen (to_path_temp , "w " );
1058
+ out = fopen (to_path_temp , "wb " );
1059
1059
if (out == NULL )
1060
1060
elog (ERROR , "Cannot open destination WAL file \"%s\": %s" ,
1061
1061
to_path_temp , strerror (errno ));
0 commit comments