From: Howard Chu Date: Fri, 23 Sep 2005 11:54:48 +0000 (+0000) Subject: ITS#3923 make perl_back_open symmetric with perl_back_close X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~393 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bf7194aba93c71a56327165acc6bab24bd35cafb;p=openldap ITS#3923 make perl_back_open symmetric with perl_back_close --- diff --git a/servers/slapd/back-perl/close.c b/servers/slapd/back-perl/close.c index 9a462acfb4..0ba4acfdff 100644 --- a/servers/slapd/back-perl/close.c +++ b/servers/slapd/back-perl/close.c @@ -28,20 +28,7 @@ perl_back_close( BackendInfo *bd ) { - ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex ); - perl_destruct(PERL_INTERPRETER); - - ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex ); - - return 0; -} - -int -perl_back_destroy( - BackendInfo *bd -) -{ perl_free(PERL_INTERPRETER); PERL_INTERPRETER = NULL; diff --git a/servers/slapd/back-perl/init.c b/servers/slapd/back-perl/init.c index fef6b782a9..16426708f1 100644 --- a/servers/slapd/back-perl/init.c +++ b/servers/slapd/back-perl/init.c @@ -37,18 +37,6 @@ perl_back_initialize( { char *embedding[] = { "", "-e", "0" }; - Debug( LDAP_DEBUG_TRACE, "perl backend open\n", 0, 0, 0 ); - - if( PERL_INTERPRETER != NULL ) { - Debug( LDAP_DEBUG_ANY, "perl backend open: already opened\n", - 0, 0, 0 ); - return 1; - } - - PERL_INTERPRETER = perl_alloc(); - perl_construct(PERL_INTERPRETER); - perl_parse(PERL_INTERPRETER, perl_back_xs_init, 3, embedding, (char **)NULL); - perl_run(PERL_INTERPRETER); bi->bi_open = perl_back_open; bi->bi_config = 0; @@ -86,7 +74,20 @@ perl_back_open( BackendInfo *bi ) { + Debug( LDAP_DEBUG_TRACE, "perl backend open\n", 0, 0, 0 ); + + if( PERL_INTERPRETER != NULL ) { + Debug( LDAP_DEBUG_ANY, "perl backend open: already opened\n", + 0, 0, 0 ); + return 1; + } + ldap_pvt_thread_mutex_init( &perl_interpreter_mutex ); + + PERL_INTERPRETER = perl_alloc(); + perl_construct(PERL_INTERPRETER); + perl_parse(PERL_INTERPRETER, perl_back_xs_init, 3, embedding, (char **)NULL); + perl_run(PERL_INTERPRETER); return 0; } diff --git a/servers/slapd/back-perl/proto-perl.h b/servers/slapd/back-perl/proto-perl.h index 1d9b6b9633..eb03411223 100644 --- a/servers/slapd/back-perl/proto-perl.h +++ b/servers/slapd/back-perl/proto-perl.h @@ -24,7 +24,6 @@ extern BI_init perl_back_initialize; extern BI_open perl_back_open; extern BI_close perl_back_close; -extern BI_destroy perl_back_destroy; extern BI_db_init perl_back_db_init; extern BI_db_open perl_back_db_open;