apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject [PATCH] fix apr_poll tests on Darwin
Date Tue, 31 Dec 2002 04:26:58 GMT
so i was playing with the unit tests on my os x box, and i noticed that 
there were a few tests failing in testpoll.c (clear_all_signalled and 
recv_large_pollarray).  with a little playing around, it turned out 
that we were getting spurious returned events because the select based 
poll implementation wasn't zeroing out previous results before setting 
the current ones and returning.

here's a patch that makes all the poll tests pass for me.  2 down, 12 
more to go ;-)

-garrett

===================================================================
RCS file: /home/cvspublic/apr/poll/unix/poll.c,v
retrieving revision 1.32
diff -u -d -b -w -r1.32 poll.c
--- poll/unix/poll.c    20 Sep 2002 10:42:37 -0000      1.32
+++ poll/unix/poll.c    31 Dec 2002 04:23:29 -0000
@@ -275,6 +275,10 @@
      }
  #endif

+    for (i = 0; i < *nsds; i++) {
+      aprset[i].rtnevents = 0;
+    }
+
      (*nsds) = rv;
      if ((*nsds) == 0) {
          return APR_TIMEUP;


Mime
View raw message