mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
better error handling
This commit is contained in:
parent
63b6732301
commit
2b4b2ae191
1 changed files with 2 additions and 1 deletions
|
@ -233,8 +233,9 @@ threadread(int fd, void *a, long n)
|
|||
|
||||
threadfdnoblock(fd);
|
||||
again:
|
||||
errno = 0;
|
||||
nn = read(fd, a, n);
|
||||
if(nn < 0){
|
||||
if(nn <= 0){
|
||||
if(errno == EINTR)
|
||||
goto again;
|
||||
if(errno == EAGAIN || errno == EWOULDBLOCK){
|
||||
|
|
Loading…
Reference in a new issue