Change tcgetattr error handling.

This commit is contained in:
Soumendra Ganguly 2020-08-08 05:28:42 -05:00
parent fbc9b69151
commit 535e81ebba
1 changed files with 2 additions and 3 deletions

View File

@ -128,9 +128,8 @@ setterm(struct termios *backup)
struct termios tattr;
if (tcgetattr(STDOUT_FILENO, backup) != 0) {
if (errno == EBADF)
err(EXIT_FAILURE, _("%d not valid fd"), STDOUT_FILENO);
/* errno == ENOTTY */
if (errno != ENOTTY) /* For debugger. */
err(EXIT_FAILURE, _("unexpected tcgetattr failure"));
return 0;
}
tattr = *backup;