@@ -80,8 +80,9 @@ static apr_status_t load_ldap(apr_pool_t *pool, const apr_ldap_driver_t **driver
80
80
modname = "apr_ldap-" APR_STRINGIFY (APR_MAJOR_VERSION ) ".so" ;
81
81
#endif
82
82
rv = apu_dso_load (& dlhandle , & symbol , modname , "apr__ldap_fns" , pool , err );
83
- if (rv == APR_SUCCESS ) {
83
+ if (rv == APR_SUCCESS || APR_EINIT == rv ) {
84
84
lfn = symbol ;
85
+ rv = APR_SUCCESS ;
85
86
}
86
87
87
88
if (driver ) {
@@ -93,9 +94,12 @@ static apr_status_t load_ldap(apr_pool_t *pool, const apr_ldap_driver_t **driver
93
94
return rv ;
94
95
}
95
96
96
- #define LOAD_LDAP_STUB (pool , err , failres ) \
97
- if (!lfn && (apr_ldap_get_driver(pool, NULL, err) != APR_SUCCESS)) \
98
- return failres;
97
+ #define LOAD_LDAP_STUB (pool , err ) \
98
+ { \
99
+ apr_status_t status; \
100
+ if (!lfn && ((status = apr_ldap_get_driver(pool, NULL, err)) != APR_SUCCESS)) \
101
+ return status; \
102
+ }
99
103
100
104
#define CHECK_LDAP_STUB (failres ) \
101
105
if (!lfn) \
@@ -132,15 +136,15 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_info(apr_pool_t *pool,
132
136
apu_err_t * * result_err )
133
137
{
134
138
* result_err = (apu_err_t * )apr_pcalloc (pool , sizeof (apu_err_t ));
135
- LOAD_LDAP_STUB (pool , * result_err , APR_EINIT );
139
+ LOAD_LDAP_STUB (pool , * result_err );
136
140
return lfn -> info (pool , result_err );
137
141
}
138
142
139
143
APU_DECLARE_LDAP (apr_status_t ) apr_ldap_initialise (apr_pool_t * pool ,
140
144
apr_ldap_t * * ldap ,
141
145
apu_err_t * err )
142
146
{
143
- LOAD_LDAP_STUB (pool , err , APR_EINIT );
147
+ LOAD_LDAP_STUB (pool , err );
144
148
return lfn -> initialise (pool , ldap , err );
145
149
}
146
150
@@ -150,7 +154,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get(apr_pool_t *pool,
150
154
apr_ldap_opt_t * outvalue ,
151
155
apu_err_t * err )
152
156
{
153
- LOAD_LDAP_STUB (pool , err , APR_EINIT );
157
+ LOAD_LDAP_STUB (pool , err );
154
158
return lfn -> option_get (pool , ldap , option , outvalue , err );
155
159
}
156
160
@@ -160,7 +164,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set(apr_pool_t *pool,
160
164
const apr_ldap_opt_t * invalue ,
161
165
apu_err_t * err )
162
166
{
163
- LOAD_LDAP_STUB (pool , err , APR_EINIT );
167
+ LOAD_LDAP_STUB (pool , err );
164
168
return lfn -> option_set (pool , ldap , option , invalue , err );
165
169
}
166
170
0 commit comments