mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
cbreak_mode(): take no action on invalid file descriptor
This commit is contained in:
parent
a0130a88e6
commit
ccad97dcff
@ -20,6 +20,9 @@ void sigwinch_handler(int signo){
|
||||
}
|
||||
|
||||
int cbreak_mode(int ttyfd, const struct termios* tpreserved){
|
||||
if(n->ttyfd < 0){
|
||||
return 0;
|
||||
}
|
||||
// assume it's not a true terminal (e.g. we might be redirected to a file)
|
||||
struct termios modtermios;
|
||||
memcpy(&modtermios, tpreserved, sizeof(modtermios));
|
||||
|
Loading…
x
Reference in New Issue
Block a user