Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita490120

Browse files
committed
Correctly set binary mode for SSH pipe
1 parent16fff38 commita490120

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

‎src/pg_probackup.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -679,16 +679,4 @@ extern bool parse_page(Page page, XLogRecPtr *lsn);
679679
int32do_compress(void*dst,size_tdst_size,voidconst*src,size_tsrc_size,
680680
CompressAlgalg,intlevel,constchar**errormsg);
681681

682-
#ifdefWIN32
683-
#ifdef_DEBUG
684-
#definelseek _lseek
685-
#defineopen _open
686-
#definefstat _fstat
687-
#defineread _read
688-
#defineclose _close
689-
#definewrite _write
690-
#definemkdir(dir,mode) _mkdir(dir)
691-
#endif
692-
#endif
693-
694682
#endif/* PG_PROBACKUP_H */

‎src/utils/file.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include<sys/stat.h>
44

55
#ifdefWIN32
6-
#define__thread
6+
#define__thread __declspec(thread)
77
#else
88
#include<pthread.h>
99
#endif
@@ -1258,7 +1258,12 @@ void fio_communicate(int in, int out)
12581258
structstatst;
12591259
intrc;
12601260

1261-
/* Main loop until command of processing master command */
1261+
#ifdefWIN32
1262+
SYS_CHECK(setmode(in,_O_BINARY));
1263+
SYS_CHECK(setmode(out,_O_BINARY));
1264+
#endif
1265+
1266+
/* Main loop until command of processing master command */
12621267
while ((rc=fio_read_all(in,&hdr,sizeofhdr))==sizeof(hdr)) {
12631268
if (hdr.size!=0) {
12641269
if (hdr.size>buf_size) {

‎src/utils/remote.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ bool launch_agent(void)
148148
}
149149

150150
#ifdefWIN32
151-
SYS_CHECK(_pipe(infd,PIPE_SIZE,O_BINARY)) ;
152-
SYS_CHECK(_pipe(outfd,PIPE_SIZE,O_BINARY));
151+
SYS_CHECK(_pipe(infd,PIPE_SIZE,_O_BINARY)) ;
152+
SYS_CHECK(_pipe(outfd,PIPE_SIZE,_O_BINARY));
153153
ssh_argv[2]=psprintf("%d",outfd[0]);
154154
ssh_argv[3]=psprintf("%d",infd[1]);
155155
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp