projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor improvements to error reporting in logging.
[u/mdw/putty]
/
unix
/
uxcons.c
diff --git
a/unix/uxcons.c
b/unix/uxcons.c
index
16e69fb
..
11c59a8
100644
(file)
--- a/
unix/uxcons.c
+++ b/
unix/uxcons.c
@@
-161,7
+161,8
@@
int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
- read(0, line, sizeof(line) - 1);
+ if (read(0, line, sizeof(line) - 1) <= 0)
+ /* handled below */;
tcsetattr(0, TCSANOW, &oldmode);
}
tcsetattr(0, TCSANOW, &oldmode);
}
@@
-213,7
+214,8
@@
int askalg(void *frontend, const char *algtype, const char *algname,
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
- read(0, line, sizeof(line) - 1);
+ if (read(0, line, sizeof(line) - 1) <= 0)
+ /* handled below */;
tcsetattr(0, TCSANOW, &oldmode);
}
tcsetattr(0, TCSANOW, &oldmode);
}
@@
-266,7
+268,8
@@
int askappend(void *frontend, Filename filename,
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
newmode.c_lflag |= ECHO | ISIG | ICANON;
tcsetattr(0, TCSANOW, &newmode);
line[0] = '\0';
- read(0, line, sizeof(line) - 1);
+ if (read(0, line, sizeof(line) - 1) <= 0)
+ /* handled below */;
tcsetattr(0, TCSANOW, &oldmode);
}
tcsetattr(0, TCSANOW, &oldmode);
}
@@
-344,7
+347,7
@@
int console_get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
memset(p->prompts[i]->result, 0, p->prompts[i]->result_len);
}
memset(p->prompts[i]->result, 0, p->prompts[i]->result_len);
}
- if (console_batch_mode)
+ if (
p->n_prompts &&
console_batch_mode)
return 0;
/*
return 0;
/*
@@
-416,8
+419,6
@@
int is_interactive(void)
* X11-forwarding-related things suitable for console.
*/
* X11-forwarding-related things suitable for console.
*/
-const char platform_x11_best_transport[] = "unix";
-
char *platform_get_x_display(void) {
return dupstr(getenv("DISPLAY"));
}
char *platform_get_x_display(void) {
return dupstr(getenv("DISPLAY"));
}