This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: poll() bugs and patch


On Wed, Mar 13, 2002 at 02:30:35PM +0100, Boris Schaeling wrote:
> There are several bugs in poll():
> - poll() must return 0 if no descriptor is ready and the timer expires. It
> works correctly if all descriptors are non-negative. Otherwise poll()
> returns the count of negative descriptors which is wrong.
> - The implementation of poll() must call cygwin_select() even if all
> descriptors are invalid. Currently poll() returns immediately - and ignores
> any timer value. The return value is wrong again because of the bug above.
> - If the timer expires revents must be 0 and must not be set to anything
> else like POLLNVAL, POLLHUP or whatever.
> - If cygwin_select() returns -1 revents must be 0 and must not be set to
> POLLERR. Eg. a signal interrupting poll() doesn't mean an error has occured
> for a TCP connection.
> - If an error is pending revents must be set to POLLERR.
> - The implementation of poll() has a local variable called open_fds that
> isn't used. I can't see why this variable exists.
> 
> I've attached three files:
> - newpoll.cc has a new implementation of poll() which fixes the bugs.
> - patch.cc is the patch.
> - polltest.c is a testcase.
> 
> I rebuilt cygwin1.dll with my poll() function so there should be no problems
> when compiling.

Thanks for the patch but that's not quite the way to contribute a
patch.  I'm missing a ChangeLog entry and, worse, we don't have a
copyright assignment from you.  Due to licensing issues we need the
copyright assignment as described on http://cygwin.com/contrib.html
before we can incorporate the patch.  It's bigger than what is
slipping through the cracks as "insignificant".

It would really be nice if you could send us this assignment (which
unfortunately has to be send via snail mail so this takes some time)
and then resubmit your patch to cygwin-patches@cygwin.com.

Oh, could you please rename the patch file?  It's somewhat
irritating to have a *.cc suffix for a patch file. `poll.diff' or
poll.patch' would be nice...

Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]