Skip to content

Commit

Permalink
stdio: ignore EIO for terminals
Browse files Browse the repository at this point in the history
when the terminal is closed, we get EIO.  Let's treat it as a EOF.

Closes: #440

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Aug 10, 2023
1 parent 77ce312 commit f38419a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ctr_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ static bool read_stdio(int fd, stdpipe_t pipe, gboolean *eof)
*eof = true;
return false;
} else if (num_read < 0) {
if (errno == EIO && isatty(fd)){
return false;
}
nwarnf("stdio_input read failed %s", strerror(errno));
return false;
} else {
Expand Down

0 comments on commit f38419a

Please sign in to comment.