apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r650118 - in /apr/apr/trunk: include/apr_poll.h poll/unix/epoll.c poll/unix/kqueue.c poll/unix/poll.c poll/unix/port.c poll/unix/select.c
Date Mon, 21 Apr 2008 12:04:11 GMT
Author: mturk
Date: Mon Apr 21 05:04:08 2008
New Revision: 650118

URL: http://svn.apache.org/viewvc?rev=650118&view=rev
Log:
Return APR_EINTR only there was no additional descriptors signaled at the time of wakeup call

Modified:
    apr/apr/trunk/include/apr_poll.h
    apr/apr/trunk/poll/unix/epoll.c
    apr/apr/trunk/poll/unix/kqueue.c
    apr/apr/trunk/poll/unix/poll.c
    apr/apr/trunk/poll/unix/port.c
    apr/apr/trunk/poll/unix/select.c

Modified: apr/apr/trunk/include/apr_poll.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_poll.h?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_poll.h (original)
+++ apr/apr/trunk/include/apr_poll.h Mon Apr 21 05:04:08 2008
@@ -169,7 +169,7 @@
  * @param descriptors Array of signalled descriptors (output parameter)
  * @remark If the pollset has been created with APR_POLLSET_WAKEABLE
  *         and the wakeup has been called while waiting for activity
- *         return value is APR_EINTR and num is set to number of signalled
+ *         return value is APR_EINTR in case there was no signaled
  *         descriptors at the time of wakeup call.
  */
 APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,

Modified: apr/apr/trunk/poll/unix/epoll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/epoll.c?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/epoll.c (original)
+++ apr/apr/trunk/poll/unix/epoll.c Mon Apr 21 05:04:08 2008
@@ -335,9 +335,6 @@
                     fd.desc_type == APR_POLL_FILE &&
                     fd.desc.f == pollset->wakeup_pipe[0]) {
                         drain_wakeup_pipe(pollset);
-                        /* XXX: Is this a correct return value ?
-                         * We might simply return APR_SUCEESS.
-                         */
                         rv = APR_EINTR;
                 }
                 else {
@@ -347,7 +344,8 @@
                     j++;
                 }
             }
-            (*num) = j;
+            if ((*num) = j)
+                rv = APR_SUCCESS;
         }
         else {
             for (i = 0, j = 0; i < ret; i++) {
@@ -356,9 +354,6 @@
                     fd.desc_type == APR_POLL_FILE &&
                     fd.desc.f == pollset->wakeup_pipe[0]) {
                         drain_wakeup_pipe(pollset);
-                        /* XXX: Is this a correct return value ?
-                         * We might simply return APR_SUCEESS.
-                         */
                         rv = APR_EINTR;
                 }
                 else {
@@ -368,7 +363,8 @@
                     j++;
                 }
             }
-            (*num) = j;
+            if ((*num) = j)
+                rv = APR_SUCCESS;
         }
 
         if (descriptors) {

Modified: apr/apr/trunk/poll/unix/kqueue.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/kqueue.c?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/kqueue.c (original)
+++ apr/apr/trunk/poll/unix/kqueue.c Mon Apr 21 05:04:08 2008
@@ -326,9 +326,6 @@
                 fd.desc_type == APR_POLL_FILE &&
                 fd.desc.f == pollset->wakeup_pipe[0]) {
                 drain_wakeup_pipe(pollset);
-                /* XXX: Is this a correct return value ?
-                 * We might simply return APR_SUCEESS.
-                 */
                 rv = APR_EINTR;
             }
             else {
@@ -339,7 +336,8 @@
                 j++;
             }
         }
-        (*num) = j;
+        if ((*num) = j)
+            rv = APR_SUCCESS;
         if (descriptors) {
             *descriptors = pollset->result_set;
         }

Modified: apr/apr/trunk/poll/unix/poll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/poll.c?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/poll.c (original)
+++ apr/apr/trunk/poll/unix/poll.c Mon Apr 21 05:04:08 2008
@@ -345,9 +345,6 @@
                     pollset->query_set[i].desc_type == APR_POLL_FILE &&
                     pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) {
                         drain_wakeup_pipe(pollset);
-                        /* XXX: Is this a correct return value ?
-                         * We might simply return APR_SUCEESS.
-                         */
                         rv = APR_EINTR;
                 }
                 else {
@@ -358,7 +355,8 @@
                 }
             }
         }
-        (*num) = j;
+        if ((*num) = j)
+            rv = APR_SUCCESS;
     }
     if (descriptors && (*num))
         *descriptors = pollset->result_set;

Modified: apr/apr/trunk/poll/unix/port.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/port.c?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/port.c (original)
+++ apr/apr/trunk/poll/unix/port.c Mon Apr 21 05:04:08 2008
@@ -373,9 +373,6 @@
                 fd.desc_type == APR_POLL_FILE &&
                 fd.desc.f == pollset->wakeup_pipe[0]) {
                 drain_wakeup_pipe(pollset);
-                /* XXX: Is this a correct return value ?
-                 * We might simply return APR_SUCEESS.
-                 */
                 rv = APR_EINTR;
             }
             else {
@@ -392,7 +389,8 @@
             }
         }
         pollset_unlock_rings();
-        (*num) = j;
+        if ((*num) = j)
+            rv = APR_SUCCESS;
         if (descriptors) {
             *descriptors = pollset->result_set;
         }

Modified: apr/apr/trunk/poll/unix/select.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c?rev=650118&r1=650117&r2=650118&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/select.c (original)
+++ apr/apr/trunk/poll/unix/select.c Mon Apr 21 05:04:08 2008
@@ -493,9 +493,6 @@
             if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
                 pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) {
                 drain_wakeup_pipe(pollset);
-                /* XXX: Is this a correct return value ?
-                 * We might simply return APR_SUCEESS.
-                 */
                 rv = APR_EINTR;
                 continue;
             }
@@ -523,7 +520,8 @@
             j++;
         }
     }
-    (*num) = j;
+    if ((*num) = j)
+        rv = APR_SUCCESS;
 
     if (descriptors)
         *descriptors = pollset->result_set;



Mime
View raw message