diff --git a/src/pg_probackup.h b/src/pg_probackup.h index 42002829..36e23db4 100644 --- a/src/pg_probackup.h +++ b/src/pg_probackup.h @@ -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 diff --git a/src/utils/file.c b/src/utils/file.c index 74f60375..d9f669a3 100644 --- a/src/utils/file.c +++ b/src/utils/file.c @@ -344,6 +344,7 @@ fio_disconnect(void) SYS_CHECK(close(fio_stdout)); fio_stdin = 0; fio_stdout = 0; + wait_ssh(); } } diff --git a/src/utils/remote.c b/src/utils/remote.c index 681d8fb8..6535bf29 100644 --- a/src/utils/remote.c +++ b/src/utils/remote.c @@ -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[]) {