version 1.183, 2018/04/10 00:10:49 |
version 1.184, 2018/04/13 05:04:12 |
|
|
errno = olderrno; |
errno = olderrno; |
} |
} |
|
|
|
/*ARGSUSED*/ |
static void |
static void |
|
sigchld_handler(int sig) |
|
{ |
|
int save_errno = errno; |
|
pid_t pid; |
|
const char msg[] = "\rConnection closed. \n"; |
|
|
|
/* Report if ssh transport process dies. */ |
|
while ((pid = waitpid(sshpid, NULL, WNOHANG)) == -1 && errno == EINTR) |
|
continue; |
|
if (pid == sshpid) |
|
(void)write(STDERR_FILENO, msg, sizeof(msg) - 1); |
|
|
|
errno = save_errno; |
|
} |
|
|
|
static void |
help(void) |
help(void) |
{ |
{ |
printf("Available commands:\n" |
printf("Available commands:\n" |
|
|
if (err != 0) |
if (err != 0) |
break; |
break; |
} |
} |
|
signal(SIGCHLD, SIG_DFL); |
free(remote_path); |
free(remote_path); |
free(startdir); |
free(startdir); |
free(conn); |
free(conn); |
|
|
signal(SIGTSTP, suspchild); |
signal(SIGTSTP, suspchild); |
signal(SIGTTIN, suspchild); |
signal(SIGTTIN, suspchild); |
signal(SIGTTOU, suspchild); |
signal(SIGTTOU, suspchild); |
|
signal(SIGCHLD, sigchld_handler); |
close(c_in); |
close(c_in); |
close(c_out); |
close(c_out); |
} |
} |