termpty: handle read() from tty pair when the other end has died, on some BSD
In such a case, read() returns 0 and sets errno to ECHILD…
This commit is contained in:
parent
7508c8658b
commit
5770c51d86
|
@ -184,8 +184,10 @@ _cb_fd_read(void *data, Ecore_Fd_Handler *fd_handler)
|
|||
rbuf++;
|
||||
len--;
|
||||
}
|
||||
errno = 0;
|
||||
len = read(ty->fd, rbuf, len);
|
||||
if (len < 0 && errno != EAGAIN)
|
||||
if ((len < 0 && errno != EAGAIN) ||
|
||||
(len == 0 && errno != 0))
|
||||
{
|
||||
/* Do not print error if the child has exited */
|
||||
if (ty->pid != -1)
|
||||
|
|
Loading…
Reference in New Issue