version 1.165, 2009/12/20 07:28:36 |
version 1.166, 2010/07/01 13:06:59 |
|
|
exit(1); |
exit(1); |
} |
} |
|
|
|
static void |
|
suspchild(int signo) |
|
{ |
|
int status; |
|
|
|
if (do_cmd_pid > 1) { |
|
kill(do_cmd_pid, signo); |
|
while (waitpid(do_cmd_pid, &status, WUNTRACED) == -1 && |
|
errno == EINTR) |
|
; |
|
kill(getpid(), SIGSTOP); |
|
} |
|
} |
|
|
static int |
static int |
do_local_cmd(arglist *a) |
do_local_cmd(arglist *a) |
{ |
{ |
|
|
/* Free the reserved descriptors. */ |
/* Free the reserved descriptors. */ |
close(reserved[0]); |
close(reserved[0]); |
close(reserved[1]); |
close(reserved[1]); |
|
|
|
signal(SIGTSTP, suspchild); |
|
signal(SIGTTIN, suspchild); |
|
signal(SIGTTOU, suspchild); |
|
|
/* Fork a child to execute the command on the remote host using ssh. */ |
/* Fork a child to execute the command on the remote host using ssh. */ |
do_cmd_pid = fork(); |
do_cmd_pid = fork(); |