]> git.sur5r.net Git - openldap/commitdiff
ITS#3923 make perl_back_open symmetric with perl_back_close
authorHoward Chu <hyc@openldap.org>
Fri, 23 Sep 2005 11:54:48 +0000 (11:54 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 23 Sep 2005 11:54:48 +0000 (11:54 +0000)
servers/slapd/back-perl/close.c
servers/slapd/back-perl/init.c
servers/slapd/back-perl/proto-perl.h

index 9a462acfb4b5a2987f7082ed2848cbd01147e5f4..0ba4acfdff241419e93352b9cb5dccc93844a76e 100644 (file)
@@ -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;
 
index fef6b782a9bda0338a8d53e6504017a52812d2dc..16426708f10af0ddc39d8870da4fda71ad543e1c 100644 (file)
@@ -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;
 }
 
index 1d9b6b963324879c07ad5b341b50be832b4930f8..eb034112237173e1587c2516c22f2fdb412200e8 100644 (file)
@@ -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;