Mail Archives: cygwin/2002/03/19/07:52:20
------=_NextPart_000_0002_01C1CF4A.FC83A520
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
> -----Ursprüngliche Nachricht-----
> Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]Im Auftrag
> von Corinna Vinschen
> Gesendet: Dienstag, 19. März 2002 11:55
> An: cygwin AT cygwin DOT com
> Betreff: Re: modified poll() patch
> [...]
> thanks for the patch but could you please send a diff related to
> the latest from current cvs? I didn't back out your patch since
Hi Corinna,
I've attached patch and changelog.
Boris
------=_NextPart_000_0002_01C1CF4A.FC83A520
Content-Type: application/octet-stream;
name="change.log2"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="change.log2"
2002-03-19 Boris Schaeling <boriss AT web DOT de> =0A=
=0A=
* poll.cc: add support for invalid descriptors =0A=
(invalid means positive descriptors including 0 =0A=
which are not open) =0A=
------=_NextPart_000_0002_01C1CF4A.FC83A520
Content-Type: application/octet-stream;
name="poll.patch2"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="poll.patch2"
--- poll.cc Tue Mar 19 13:23:26 2002=0A=
+++ newpoll2.cc Sat Mar 16 02:06:24 2002=0A=
@@ -50,41 +50,51 @@ poll (struct pollfd *fds, unsigned int n=0A=
memset (write_fds, 0, fds_size);=0A=
memset (except_fds, 0, fds_size);=0A=
=0A=
+ int invalid_fds =3D 0; =0A=
for (unsigned int i =3D 0; i < nfds; ++i) =0A=
{ =0A=
fds[i].revents =3D 0; =0A=
if (!cygheap->fdtab.not_open(fds[i].fd)) =0A=
- { =0A=
- if (fds[i].events & POLLIN) =0A=
- FD_SET(fds[i].fd, read_fds); =0A=
- if (fds[i].events & POLLOUT) =0A=
- FD_SET(fds[i].fd, write_fds); =0A=
- if (fds[i].events & POLLPRI) =0A=
- FD_SET(fds[i].fd, except_fds); =0A=
- } =0A=
+ { =0A=
+ if (fds[i].events & POLLIN) =0A=
+ FD_SET(fds[i].fd, read_fds); =0A=
+ if (fds[i].events & POLLOUT) =0A=
+ FD_SET(fds[i].fd, write_fds); =0A=
+ if (fds[i].events & POLLPRI) =0A=
+ FD_SET(fds[i].fd, except_fds); =0A=
+ } =0A=
+ else if (fds[i].fd >=3D 0) =0A=
+ { =0A=
+ ++invalid_fds; =0A=
+ fds[i].revents =3D POLLNVAL; =0A=
+ } =0A=
} =0A=
=0A=
- int ret =3D cygwin_select (max_fd + 1, read_fds, write_fds, =
except_fds, timeout < 0 ? NULL : &tv);=0A=
+ if (invalid_fds) =0A=
+ return invalid_fds; =0A=
+=0A=
+ int ret =3D cygwin_select (max_fd + 1, read_fds, write_fds, =
except_fds, timeout < 0 ? NULL : &tv); =0A=
=0A=
if (ret > 0) =0A=
for (unsigned int i =3D 0; i < nfds; ++i) =0A=
{ =0A=
- if (fds[i].fd < 0) =0A=
- fds[i].revents =3D POLLNVAL; =0A=
- else if (cygheap->fdtab.not_open(fds[i].fd)) =0A=
- fds[i].revents =3D POLLHUP; =0A=
- else =0A=
- { =0A=
- if (FD_ISSET(fds[i].fd, read_fds)) =0A=
- fds[i].revents |=3D POLLIN; =0A=
- if (FD_ISSET(fds[i].fd, write_fds)) =0A=
- fds[i].revents |=3D POLLOUT; =0A=
- if (FD_ISSET(fds[i].fd, read_fds) && FD_ISSET(fds[i].fd, =
write_fds)) =0A=
- fds[i].revents |=3D POLLERR; =0A=
- if (FD_ISSET(fds[i].fd, except_fds)) =0A=
- fds[i].revents |=3D POLLPRI; =0A=
- } =0A=
+ if (fds[i].fd >=3D 0) =0A=
+ { =0A=
+ if (cygheap->fdtab.not_open(fds[i].fd)) =0A=
+ fds[i].revents =3D POLLHUP; =0A=
+ else =0A=
+ { =0A=
+ if (FD_ISSET(fds[i].fd, read_fds)) =0A=
+ fds[i].revents |=3D POLLIN; =0A=
+ if (FD_ISSET(fds[i].fd, write_fds)) =0A=
+ fds[i].revents |=3D POLLOUT; =0A=
+ if (FD_ISSET(fds[i].fd, read_fds) && =
FD_ISSET(fds[i].fd, write_fds)) =0A=
+ fds[i].revents |=3D POLLERR; =0A=
+ if (FD_ISSET(fds[i].fd, except_fds)) =0A=
+ fds[i].revents |=3D POLLPRI; =0A=
+ } =0A=
+ } =0A=
} =0A=
=0A=
return ret; =0A=
-} =0A=
+} =0A=
\ No newline at end of file=0A=
------=_NextPart_000_0002_01C1CF4A.FC83A520
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_NextPart_000_0002_01C1CF4A.FC83A520--
- Raw text -