Various tty types come up with cols/rows not initialized (i.e. set to
zero). Let's detect these cases, and return a better error than EIO,
simply to make things easier to debug.
return -errno;
if (ws.ws_col <= 0)
- return -EIO;
+ return -ENODATA; /* some tty types come up with invalid row/column initially, return a recognizable error for that */
return ws.ws_col;
}
return -errno;
if (ws.ws_row <= 0)
- return -EIO;
+ return -ENODATA; /* some tty types come up with invalid row/column initially, return a recognizable error for that */
return ws.ws_row;
}