@@ -865,7 +865,7 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
865865#endif
866866
867867 /* open file for read */
868- in = fopen (from_path , "r " );
868+ in = fopen (from_path , "rb " );
869869 if (in == NULL )
870870 elog (ERROR , "Cannot open source WAL file \"%s\": %s" , from_path ,
871871 strerror (errno ));
@@ -896,7 +896,7 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
896896
897897 snprintf (to_path_temp , sizeof (to_path_temp ), "%s.partial" , to_path );
898898
899- out = fopen (to_path_temp , "w " );
899+ out = fopen (to_path_temp , "wb " );
900900 if (out == NULL )
901901 elog (ERROR , "Cannot open destination WAL file \"%s\": %s" ,
902902 to_path_temp , strerror (errno ));
@@ -1018,7 +1018,7 @@ get_wal_file(const char *from_path, const char *to_path)
10181018#endif
10191019
10201020 /* open file for read */
1021- in = fopen (from_path , "r " );
1021+ in = fopen (from_path , "rb " );
10221022 if (in == NULL )
10231023 {
10241024#ifdef HAVE_LIBZ
@@ -1055,7 +1055,7 @@ get_wal_file(const char *from_path, const char *to_path)
10551055 /* open backup file for write */
10561056 snprintf (to_path_temp , sizeof (to_path_temp ), "%s.partial" , to_path );
10571057
1058- out = fopen (to_path_temp , "w " );
1058+ out = fopen (to_path_temp , "wb " );
10591059 if (out == NULL )
10601060 elog (ERROR , "Cannot open destination WAL file \"%s\": %s" ,
10611061 to_path_temp , strerror (errno ));
0 commit comments