Skip to content

Commit 070d69c

Browse files
committed
Bug fixed for support FREE_BSD issue
1 parent bba4a52 commit 070d69c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/ngx_link_func_module.c

+15-1
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,11 @@ ngx_http_link_func_proceed_init_calls(ngx_cycle_t* cycle, ngx_http_link_func_sr
639639
/**** Init the client apps ngx_http_link_func_init ***/
640640
char *error;
641641
ngx_http_link_func_app_cycle_handler func;
642+
643+
#if __FreeBSD__
644+
(void) dlerror();
645+
#endif
646+
642647
*(void**)(&func) = dlsym(scf->_app, (const char*)"ngx_link_func_init_cycle");
643648
if ((error = dlerror()) != NULL) {
644649
ngx_log_error(NGX_LOG_WARN, cycle->log, 0, "Unable to init call %s , skipped init called", error);
@@ -904,6 +909,11 @@ ngx_http_link_func_module_init(ngx_cycle_t *cycle) {
904909
ngx_http_link_func_loc_conf_t *lcf = cflq->_loc_conf;
905910
if ( lcf && lcf->_method_name.len > 0 ) {
906911
if ( ( lcf->_handler = ngx_http_link_func_get_duplicate_handler(scf, &lcf->_method_name) ) == NULL ) {
912+
913+
#if __FreeBSD__
914+
(void) dlerror();
915+
#endif
916+
907917
*(void**)(&lcf->_handler) = dlsym(scf->_app, (const char*)lcf->_method_name.data);
908918
if ((error = dlerror()) != NULL) {
909919
ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "Error function load: %s", error);
@@ -1001,6 +1011,11 @@ ngx_http_link_func_process_exit(ngx_cycle_t *cycle) {
10011011
if (scf && scf->_app ) {
10021012
/*** Exiting the client apps ***/
10031013
ngx_http_link_func_app_cycle_handler func;
1014+
1015+
#if __FreeBSD__
1016+
(void) dlerror();
1017+
#endif
1018+
10041019
*(void**)(&func) = dlsym(scf->_app, (const char*)"ngx_link_func_exit_cycle");
10051020
if ((error = dlerror()) != NULL) {
10061021
ngx_log_error(NGX_LOG_WARN, cycle->log, 0, "Unable to exit call %s , skipped exit called", error);
@@ -2637,4 +2652,3 @@ ngx_http_link_func_https_request(ngx_conf_t *cf, ngx_http_link_func_srv_conf_t*
26372652
#endif
26382653

26392654
/*** End Download Feature Support ***/
2640-

0 commit comments

Comments
 (0)