1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-07 13:40:17 +02:00

Wait for ssh process completion in fio_disconnect

This commit is contained in:
Konstantin Knizhnik 2019-07-02 16:49:38 +03:00
parent abfb2b56f5
commit d57b65fa87
3 changed files with 11 additions and 0 deletions

View File

@ -577,6 +577,7 @@ extern bool in_backup_list(parray *backup_list, pgBackup *target_backup);
extern int get_backup_index_number(parray *backup_list, pgBackup *backup);
extern bool launch_agent(void);
extern void launch_ssh(char* argv[]);
extern void wait_ssh(void);
#define COMPRESS_ALG_DEFAULT NOT_DEFINED_COMPRESS
#define COMPRESS_LEVEL_DEFAULT 1

View File

@ -344,6 +344,7 @@ fio_disconnect(void)
SYS_CHECK(close(fio_stdout));
fio_stdin = 0;
fio_stdout = 0;
wait_ssh();
}
}

View File

@ -53,6 +53,7 @@ static int split_options(int argc, char* argv[], int max_options, char* options)
}
static int child_pid;
#if 0
static void kill_child(void)
{
@ -60,6 +61,14 @@ static void kill_child(void)
}
#endif
void wait_ssh(void)
{
int status;
waitpid(child_pid, &status, 0);
elog(LOG, "SSH process %d is terminated with status %d", child_pid, status);
}
#ifdef WIN32
void launch_ssh(char* argv[])
{