replace sleep with waitpid

This commit is contained in:
Andrew Pamment 2016-08-10 11:22:55 +10:00
parent ddd874c4b8
commit b84d9af16a
2 changed files with 353 additions and 352 deletions

3
main.c
View File

@ -448,10 +448,11 @@ static int ssh_copy_chan_to_fd(ssh_session session,
static void ssh_chan_close(ssh_session session, ssh_channel channel, void *userdata) {
int fd = *(int*)userdata;
int status;
(void)session;
(void)channel;
kill(bbs_pid, SIGTERM);
sleep(10);
waitpid(bbs_pid, &status, 0);
close(fd);
}