On 06/03/2008 03:34 PM, Ruediger Pluem wrote:

Any comments on belows patches? If not I will commit, but don't cry then if it
breaks some platform on trunk. You have been asked before :-).


Some test results from SPARC Solaris (8, 9, 10) with Solaris LDAP SDK.
All test pass except for the well known testshm failure. Even testsock
passes as I have an IPV6 interface configured on my boxes.
But I get a bunch of compiler warnings.

APR:


passwd/apr_getpass.c:97: warning: `get_password' defined but not used
poll/unix/port.c: In function `apr_pollset_remove':
poll/unix/port.c:205: warning: 'err' might be used uninitialized in this function

These get fixed by the following patch (some remote eyes please before I commit):

Index: passwd/apr_getpass.c
===================================================================
--- passwd/apr_getpass.c        (Revision 662580)
+++ passwd/apr_getpass.c        (Arbeitskopie)
@@ -70,7 +70,7 @@

 #define ERR_OVERFLOW 5

-#ifndef HAVE_GETPASS
+#if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE)

 /* MPE, Win32, NetWare and BeOS all lack a native getpass() */


Index: poll/unix/port.c
===================================================================
--- poll/unix/port.c    (Revision 662580)
+++ poll/unix/port.c    (Arbeitskopie)
@@ -264,7 +264,7 @@
     pfd_elem_t *ep;
     apr_status_t rv = APR_SUCCESS;
     int res;
-    int err;
+    int err = 0;

     pollset_lock_rings();



atomic/unix/solaris.c: In function `apr_atomic_casptr':
atomic/unix/solaris.c:71: warning: passing arg 2 of `atomic_cas_ptr' discards qualifiers from pointer target type

This is the one Henry already noted and it is fixed by Henrys patch:

Index: atomic/unix/solaris.c
===================================================================
--- atomic/unix/solaris.c       (Revision 662580)
+++ atomic/unix/solaris.c       (Arbeitskopie)
@@ -68,7 +68,7 @@

APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
 {
-    return atomic_cas_ptr(mem, cmp, (void*) with);
+    return atomic_cas_ptr(mem, (void*) cmp, with);
 }



threadproc/unix/thread.c: In function `apr_thread_once_init':
threadproc/unix/thread.c:306: warning: missing braces around initializer
threadproc/unix/thread.c:306: warning: (near initialization for `once_init.__pthread_once_pad')

To me this seems to be a bug in the Solaris include files in the definition of PTHREAD_ONCE_INIT. The following patch fixes this on Solaris, but breaks it on other platforms:

Index: threadproc/unix/thread.c
===================================================================
--- threadproc/unix/thread.c    (Revision 662580)
+++ threadproc/unix/thread.c    (Arbeitskopie)
@@ -303,7 +303,7 @@
APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
                                                apr_pool_t *p)
 {
-    static const pthread_once_t once_init = PTHREAD_ONCE_INIT;
+    static const pthread_once_t once_init = {PTHREAD_ONCE_INIT};

     *control = apr_palloc(p, sizeof(**control));
     (*control)->once = once_init;


So I am a little clueless here what to do.

APR-UTIL:

ldap/apr_ldap_option.c: In function `option_set_cert':
ldap/apr_ldap_option.c:401: warning: unused variable `ents'
ldap/apr_ldap_option.c:402: warning: unused variable `i'
ldap/apr_ldap_rebind.c:187: warning: `apr_ldap_rebind_lookup' defined but not used
dbd/apr_dbd.c: In function `apr_dbd_prepare':
dbd/apr_dbd.c:372: warning: subscript has type `char'
dbd/apr_dbd.c:388: warning: subscript has type `char'


These get fixed by the following patch (some remote eyes please before I commit as this if stuff is really tricky and do not have that much platforms available):

Index: ldap/apr_ldap_rebind.c
===================================================================
--- ldap/apr_ldap_rebind.c      (Revision 662580)
+++ ldap/apr_ldap_rebind.c      (Arbeitskopie)
@@ -182,7 +182,7 @@
     return APR_SUCCESS;
 }

-
+#if APR_HAS_TIVOLI_LDAPSDK || APR_HAS_OPENLDAP_LDAPSDK || APR_HAS_NOVELL_LDAPSDK
 static apr_ldap_rebind_entry_t *apr_ldap_rebind_lookup(LDAP *ld)
 {
     apr_ldap_rebind_entry_t *tmp_xref, *match = NULL;
@@ -212,6 +212,7 @@

     return (match);
 }
+#endif

 #if APR_HAS_TIVOLI_LDAPSDK

Index: ldap/apr_ldap_option.c
===================================================================
--- ldap/apr_ldap_option.c      (Revision 662580)
+++ ldap/apr_ldap_option.c      (Arbeitskopie)
@@ -397,9 +397,11 @@
                            const void *invalue, apr_ldap_err_t *result)
 {
 #if APR_HAS_LDAP_SSL
+#if APR_HAS_LDAPSSL_CLIENT_INIT || APR_HAS_OPENLDAP_LDAPSDK
     apr_array_header_t *certs = (apr_array_header_t *)invalue;
struct apr_ldap_opt_tls_cert_t *ents = (struct apr_ldap_opt_tls_cert_t *)certs->elts;
     int i = 0;
+#endif

     /* Netscape/Mozilla/Solaris SDK */
#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSDK
Index: dbd/apr_dbd.c
===================================================================
--- dbd/apr_dbd.c       (Revision 662580)
+++ dbd/apr_dbd.c       (Arbeitskopie)
@@ -25,6 +25,7 @@
 #include "apr_strings.h"
 #include "apr_hash.h"
 #include "apr_thread_mutex.h"
+#include "apr_lib.h"

 #include "apu_internal.h"
 #include "apr_dbd_internal.h"
@@ -369,7 +370,7 @@
     /* find the number of parameters in the query */
     for (q = query; *q; q++) {
         if (q[0] == '%') {
-            if (isalpha(q[1])) {
+            if (apr_isalpha(q[1])) {
                 nargs++;
             } else if (q[1] == '%') {
                 q++;
@@ -385,7 +386,7 @@

     for (p = pq, q = query, i = 0; *q; q++) {
         if (q[0] == '%') {
-            if (isalpha(q[1])) {
+            if (apr_isalpha(q[1])) {
                 switch (q[1]) {
                 case 'd': t[i] = APR_DBD_TYPE_INT;   break;
                 case 'u': t[i] = APR_DBD_TYPE_UINT;  break;




Regards

RĂ¼diger

Reply via email to