> From: Justin Erenkrantz [mailto:[EMAIL PROTECTED] > > On Sat, Jul 06, 2002 at 08:32:18AM -0700, Ryan Bloom wrote: > > Because if Apache can't get it right, then I am assuming that nobody > > else can either. I had originally coded it to use *nsds just as you > > describe below, and it didn't pass any tests, because throughout the > > code people were passing 0 as *nsds. I decided to fix an API problem > > that I created years ago by using the same variable for both input and > > output parameters in this patch. I am not tied to adding num, but I do > > believe that it is the correct approach. > > I vote to fix httpd rather than add an extra parameter. Perhaps we > need to make it clearer that *nsds is the number of fd's on input. > But, I know that I was under that impression by reading the docs. > However, I can see where people were confused if they read the docs.
I vote to fix the API so that these kinds of mistakes can't happen in the future. I made a lot of mistakes when I designed APR (even though Manoj tried to convince me I was wrong). One of those mistakes is having functions use a single variable for both input and result parameters. I would like to fix that mistake for apr_poll now, as long as we are changing the implementation. BTW, I should also mention that the APR_POLL_LASTDESC enum is only there for backwards compat. Most code that uses apr_poll would never use that enum. Ryan