]> git.sur5r.net Git - openldap/blob - servers/slapd/back-tcl/tcl_close.c
Added return()
[openldap] / servers / slapd / back-tcl / tcl_close.c
1 /*
2  * close.c - tcl close routines
3  *
4  * Copyright 1999, Ben Collins <bcollins@debian.org>, All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 #include "portable.h"
13
14 #include <stdio.h>
15
16 #include "slap.h"
17 #include "tcl_back.h"
18
19 int
20 tcl_back_close (
21         BackendInfo * bi
22 )
23 {
24         return 0;
25 }
26
27 int
28 tcl_back_destroy(
29                 BackendInfo *bi
30 )
31 {
32                 ldap_pvt_thread_mutex_destroy( &tcl_interpreter_mutex );
33
34                 return 0;
35 }
36
37 int
38 tcl_back_db_destroy(
39                 BackendDB *bd
40 )
41 {
42         struct tclinfo *ti = (struct tclinfo *) bd->be_private;
43         struct i_info *ti_tmp;
44
45         ti->ti_ii->count--;
46         if (!ti->ti_ii->count && strcasecmp("default", ti->ti_ii->name)) {
47                 /* no more db's using this and it's not the default */
48                 for(ti_tmp = global_i; ti_tmp->next != ti->ti_ii; ti_tmp = ti_tmp->next)
49                         ;
50                 ti_tmp->next = ti->ti_ii->next;
51                 free(ti->ti_ii);
52                 free(ti);
53         }
54         free( bd->be_private );
55         bd->be_private = NULL;
56 }