mirror of
https://github.com/eddyem/tty_term.git
synced 2025-12-06 10:35:12 +03:00
EINTR fixed
This commit is contained in:
parent
a33179c02a
commit
655ad5bd90
5
tty.c
5
tty.c
@ -49,7 +49,10 @@ int Read_tty(TTY_descr *d){
|
|||||||
tv.tv_sec = sec; tv.tv_usec = usec;
|
tv.tv_sec = sec; tv.tv_usec = usec;
|
||||||
retval = select(d->comfd + 1, &rfds, NULL, NULL, &tv);
|
retval = select(d->comfd + 1, &rfds, NULL, NULL, &tv);
|
||||||
if(!retval) break;
|
if(!retval) break;
|
||||||
if(retval < 0) return -1;
|
if(retval < 0){
|
||||||
|
if(errno == EINTR) continue;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if(FD_ISSET(d->comfd, &rfds)){
|
if(FD_ISSET(d->comfd, &rfds)){
|
||||||
l = read(d->comfd, ptr, length);
|
l = read(d->comfd, ptr, length);
|
||||||
if(l < 1) return -1; // disconnected
|
if(l < 1) return -1; // disconnected
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user