apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Re: cvs commit: apr/support/unix waitio.c
Date Wed, 19 Nov 2003 10:00:21 GMT
On Tue, 18 Nov 2003 18:07:36 -0800, Greg Stein wrote:

>On Tue, Nov 18, 2003 at 07:50:20PM -0500, Jeff Trawick wrote:
>> Brian Havard wrote:
>> 
>> >> Log:
>> >> With the removal of apr_poll(), the apr_wait_for_io_or_timeout() function
>> >> needed to be rebuilt. Specifically, it needs a pollset, but we don't want
>> >> to allocate that all the time. Thus, we need to create it once at socket
>> >> or file creation time, and then reuse that pollset.
>> > 
>> > 
>> > You can't poll a file handle on OS/2 (APR_FILES_AS_SOCKETS == 0) so there's
>> > not really much point in having a pollset in the OS/2 apr_file_t, unless
>> > there's some grand scheme you're cooking up that I'm unaware of :)
>> > 
>> > Should I go ahead & clean them out?
>
>Yup, please. I had looked for users of the old API within httpd, but
>totally forgot to look within APR itself. Thus, I had to do a run-and-gun
>change to get everything fixed up. Mostly pattern-based fixes without a
>whole lot of thought/investigation of each specific object.

Ok, done that. Now waitio.c is broken as it's assuming a pollset member of
apr_file_t. Would you agree that this is appropriate?

Index: waitio.c
===================================================================
RCS file: /home/cvs/apr/support/unix/waitio.c,v
retrieving revision 1.7
diff -u -r1.7 waitio.c
--- waitio.c	17 Nov 2003 01:41:18 -0000	1.7
+++ waitio.c	19 Nov 2003 08:59:11 -0000
@@ -77,11 +77,15 @@
 
     /* TODO - timeout should be less each time through this loop */
     if (f) {
+#if APR_FILES_AS_SOCKETS
         pfd.desc_type = APR_POLL_FILE;
         pfd.desc.f = f;
 
         pollset = f->pollset;
         timeout = f->timeout;
+#else
+        return APR_ENOTIMPL;
+#endif
     }
     else {
         pfd.desc_type = APR_POLL_SOCKET;

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message