version 1.211, 2021/08/12 09:59:00 |
version 1.212, 2021/09/11 09:05:50 |
|
|
interactive = !batchmode && isatty(STDIN_FILENO); |
interactive = !batchmode && isatty(STDIN_FILENO); |
err = 0; |
err = 0; |
for (;;) { |
for (;;) { |
|
struct sigaction sa; |
const char *line; |
const char *line; |
int count = 0; |
int count = 0; |
|
|
|
interrupted = 0; |
|
memset(&sa, 0, sizeof(sa)); |
|
sa.sa_handler = interactive ? read_interrupt : killchild; |
|
if (sigaction(SIGINT, &sa, NULL) == -1) { |
|
debug3("sigaction(%s): %s", strsignal(SIGINT), |
|
strerror(errno)); |
|
break; |
|
} |
if (el == NULL) { |
if (el == NULL) { |
ssh_signal(SIGINT, SIG_IGN); |
|
if (interactive) |
if (interactive) |
printf("sftp> "); |
printf("sftp> "); |
if (fgets(cmd, sizeof(cmd), infile) == NULL) { |
if (fgets(cmd, sizeof(cmd), infile) == NULL) { |
if (interactive) |
if (interactive) |
printf("\n"); |
printf("\n"); |
|
if (interrupted) |
|
continue; |
break; |
break; |
} |
} |
} else { |
} else { |
struct sigaction sa; |
|
|
|
interrupted = 0; |
|
memset(&sa, 0, sizeof(sa)); |
|
sa.sa_handler = read_interrupt; |
|
if (sigaction(SIGINT, &sa, NULL) == -1) { |
|
debug3("sigaction(%s): %s", |
|
strsignal(SIGINT), strerror(errno)); |
|
break; |
|
} |
|
if ((line = el_gets(el, &count)) == NULL || |
if ((line = el_gets(el, &count)) == NULL || |
count <= 0) { |
count <= 0) { |
printf("\n"); |
printf("\n"); |