mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libast: sfio(3) fixes from ksh 93v- beta
These fixes were backported by OpenSUSE. Original patch: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-sfio.dif
This commit is contained in:
parent
63979488e6
commit
1bd0620708
7 changed files with 46 additions and 30 deletions
|
|
@ -138,7 +138,7 @@ int tm; /* time in millisecs for select/poll */
|
|||
while((np = SFPOLL(fds,m,tm)) < 0 )
|
||||
{ if(errno == eintr || errno == EAGAIN)
|
||||
errno = 0;
|
||||
else break;
|
||||
else goto report;
|
||||
}
|
||||
if(np > 0) /* poll succeeded */
|
||||
np = c;
|
||||
|
|
@ -147,14 +147,14 @@ int tm; /* time in millisecs for select/poll */
|
|||
{ f = fa[check[r]];
|
||||
|
||||
if((f->flags&SF_WRITE) && !WRREADY(f) )
|
||||
{ if(fds[m].revents&POLLOUT)
|
||||
{ if(fds[m].revents&(POLLOUT|POLLHUP|POLLERR))
|
||||
status[check[r]] |= SF_WRITE;
|
||||
}
|
||||
|
||||
if((f->flags&SF_READ) && !RDREADY(f))
|
||||
{ if((f->mode&SF_WRITE) && HASAUXFD(f))
|
||||
m += 1;
|
||||
if(fds[m].revents&POLLIN)
|
||||
if(fds[m].revents&(POLLIN|POLLHUP|POLLERR))
|
||||
status[check[r]] |= SF_READ;
|
||||
}
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ int tm; /* time in millisecs for select/poll */
|
|||
while((np = select(m+1,&rd,&wr,NIL(fd_set*),tmp)) < 0 )
|
||||
{ if(errno == eintr)
|
||||
errno = 0;
|
||||
else break;
|
||||
else goto report;
|
||||
}
|
||||
if(np > 0)
|
||||
np = c;
|
||||
|
|
@ -227,6 +227,7 @@ int tm; /* time in millisecs for select/poll */
|
|||
}
|
||||
#endif /*_lib_select*/
|
||||
|
||||
report:
|
||||
for(r = c = 0; c < n; ++c)
|
||||
{ if(status[c] == 0)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue