1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

New backend flag for needing a terminal.

This commit is contained in:
Lars Brinkhoff 2020-02-18 15:16:26 +01:00 committed by Simon Tatham
parent e2b0e90c8c
commit ad6987e1b1
3 changed files with 13 additions and 0 deletions

View File

@ -482,6 +482,7 @@ enum {
/* Backend flags */
#define BACKEND_RESIZE_FORBIDDEN 0x01 /* Backend does not allow
resizing terminal */
#define BACKEND_NEEDS_TERMINAL 0x02 /* Backend must have terminal */
struct Backend {
const BackendVtable *vt;

View File

@ -820,6 +820,12 @@ int main(int argc, char **argv)
return 1;
}
if (backvt->flags & BACKEND_NEEDS_TERMINAL) {
fprintf(stderr,
"Plink must have a terminal to run.\n");
return 1;
}
/*
* Block SIGPIPE, so that we'll get EPIPE individually on
* particular network connections that go wrong.

View File

@ -393,6 +393,12 @@ int main(int argc, char **argv)
return 1;
}
if (vt->flags & BACKEND_NEEDS_TERMINAL) {
fprintf(stderr,
"Plink must have a terminal to run.\n");
return 1;
}
sk_init();
if (p_WSAEventSelect == NULL) {
fprintf(stderr, "Plink requires WinSock 2\n");