apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r744622 - in /apr/apr/trunk/poll/unix: pollcb.c pollset.c
Date Sun, 15 Feb 2009 07:43:44 GMT
Author: mturk
Date: Sun Feb 15 07:43:44 2009
New Revision: 744622

URL: http://svn.apache.org/viewvc?rev=744622&view=rev
Log:
Always set return object pointer to NULL if create failed.

Modified:
    apr/apr/trunk/poll/unix/pollcb.c
    apr/apr/trunk/poll/unix/pollset.c

Modified: apr/apr/trunk/poll/unix/pollcb.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollcb.c?rev=744622&r1=744621&r2=744622&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollcb.c (original)
+++ apr/apr/trunk/poll/unix/pollcb.c Sun Feb 15 07:43:44 2009
@@ -108,8 +108,10 @@
         }
         /* Try with default provider */
         provider = pollcb_provider(pollset_default_method);
-        if (!provider)
+        if (!provider) {
+            *pollcb = NULL;
             return APR_ENOTIMPL;
+        }
         rv = (*provider->create)(*pollcb, size, p, flags);
         if (rv != APR_SUCCESS) {
             *pollcb = NULL;

Modified: apr/apr/trunk/poll/unix/pollset.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollset.c?rev=744622&r1=744621&r2=744622&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollset.c (original)
+++ apr/apr/trunk/poll/unix/pollset.c Sun Feb 15 07:43:44 2009
@@ -201,6 +201,7 @@
     while (provider == NULL) {
         provider = pollset_provider(method);
         if (!provider) {
+            *pollset = NULL;
             if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT)
                 return APR_ENOTIMPL;
             if (method == pollset_default_method)
@@ -226,9 +227,11 @@
             *pollset = NULL;
             return rv;
         }
-        provider = pollset_provider(method);
-        if (!provider)
+        provider = pollset_provider(pollset_default_method);
+        if (!provider) {
+            *pollset = NULL;
             return APR_ENOTIMPL;
+        }
         rv = (*provider->create)(*pollset, size, p, flags);
         if (rv != APR_SUCCESS) {
             *pollset = NULL;



Mime
View raw message