Don't print a warning about tcgetattr if stdin is not a tty

I don't know why this doesn't happen more often, but if stdin is not a
tty not being able to get terminal attributes from it is *expected*?
This commit is contained in:
Fabian Homborg 2020-05-21 10:06:51 +02:00
parent 3af715d36f
commit e51f4e5fc9

View file

@ -868,6 +868,8 @@ static bool terminal_return_from_job(job_t *j, int restore_attrs) {
// Save jobs terminal modes.
if (tcgetattr(STDIN_FILENO, &j->tmodes)) {
// If it's not a tty, it's not a tty, and there are no attributes to save (or restore)
if (errno == ENOTTY) return false;
if (errno == EIO) redirect_tty_output();
FLOGF(warning, _(L"Could not return shell to foreground"));
wperror(L"tcgetattr");