version 1.78, 2009/04/27 23:20:48 |
version 1.79, 2009/06/06 23:14:44 |
|
|
return; |
return; |
|
|
abort: |
abort: |
|
/* abort using RFC959 recommended IP,SYNC sequence */ |
/* abort using RFC959 recommended IP,SYNC sequence */ |
|
|
|
progress = oprogress; |
progress = oprogress; |
preserve = opreserve; |
preserve = opreserve; |
if (oldintp) |
if (oldintp) |
|
|
return (new); |
return (new); |
} |
} |
|
|
|
jmp_buf forceabort; |
|
|
|
/* ARGSUSED */ |
void |
void |
|
abortforce(int signo) |
|
{ |
|
fputs("Forced abort. The connection will be closed.\n", ttyout); |
|
(void)fflush(ttyout); |
|
|
|
if (cout) { |
|
(void)fclose(cout); |
|
} |
|
cout = NULL; |
|
|
|
longjmp(forceabort, 1); |
|
} |
|
|
|
void |
abort_remote(FILE *din) |
abort_remote(FILE *din) |
{ |
{ |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
int nfnd; |
int nfnd; |
struct pollfd pfd[2]; |
struct pollfd pfd[2]; |
|
sig_t oldintr; |
|
|
if (cout == NULL) { |
if (cout == NULL || setjmp(forceabort)) { |
warnx("Lost control connection for abort."); |
warnx("Lost control connection for abort."); |
if (ptabflg) |
if (ptabflg) |
code = -1; |
code = -1; |
|
|
return; |
return; |
} |
} |
|
|
|
oldintr = signal(SIGINT, abortforce); |
|
|
/* |
/* |
* send IAC in urgent mode instead of DM because 4.3BSD places oob mark |
* send IAC in urgent mode instead of DM because 4.3BSD places oob mark |
* after urgent byte rather than before as is protocol now |
* after urgent byte rather than before as is protocol now |
|
|
(void)getreply(0); |
(void)getreply(0); |
} |
} |
(void)getreply(0); |
(void)getreply(0); |
|
(void)signal(SIGINT, oldintr); |
} |
} |