1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-22 11:44:34 +02:00

Rewrite remote ssh support for Windows

This commit is contained in:
Konstantin Knizhnik 2019-04-25 19:34:11 +03:00
parent 8aba8e8940
commit 66d33a188e

View File

@ -63,11 +63,14 @@ static void kill_child(void)
#ifdef WIN32
void launch_ssh(char* argv[])
{
int infd = atoi(argv[2]);
int outfd = atoi(argv[3]);
SYS_CHECK(close(STDIN_FILENO));
SYS_CHECK(close(STDOUT_FILENO));
SYS_CHECK(dup2(outfd[0], STDIN_FILENO));
SYS_CHECK(dup2(infd[1], STDOUT_FILENO));
SYS_CHECK(dup2(infd, STDIN_FILENO));
SYS_CHECK(dup2(outfd, STDOUT_FILENO));
SYS_CHECK(execvp(argv[4], argv+4));
}