back-ldbm: Kill ldbm_ignore_nextid_file, replace with slapMode==SLAP_TOOL_MODE

This commit is contained in:
Hallvard Furuseth 1999-08-16 07:09:28 +00:00
parent 697dae9fac
commit 3b5b9e1e5f
9 changed files with 9 additions and 21 deletions

View file

@ -159,8 +159,6 @@ struct ldbminfo {
#endif
};
extern int ldbm_ignore_nextid_file;
LDAP_END_DECL
#include "proto-back-ldbm.h"

View file

@ -14,8 +14,6 @@
#include "slap.h"
#include "back-ldbm.h"
int ldbm_ignore_nextid_file = 0;
int
ldbm_back_db_config(

View file

@ -17,13 +17,13 @@
#include "slap.h"
#include "back-ldbm.h"
/* All functions except put_nextid() obey ldbm_ignore_nextid_file. */
/* All functions except put_nextid() obey slapMode == SLAP_TOOL_MODE. */
static ID next_id_read( Backend *be );
static ID next_id_get_save( Backend *be, int do_save );
#define next_id_write( be, id ) \
(ldbm_ignore_nextid_file ? (be, id, 0) : put_nextid( be, id ))
(slapMode == SLAP_TOOL_MODE ? (be, id, 0) : put_nextid( be, id ))
static ID
next_id_read( Backend *be )
@ -34,7 +34,7 @@ next_id_read( Backend *be )
char* file = li->li_nextid_file;
FILE* fp;
if ( ldbm_ignore_nextid_file )
if ( slapMode == SLAP_TOOL_MODE )
return NOID;
if ( (fp = fopen( file, "r" )) == NULL ) {

View file

@ -83,14 +83,14 @@ slap_init( int mode, char *name )
case SLAP_SERVER_MODE:
case SLAP_TOOL_MODE:
#ifdef SLAPD_BDB2
#ifdef SLAP_TIMEDSERVER_MODE
case SLAP_TIMEDSERVER_MODE:
case SLAP_TOOLID_MODE:
#endif
case SLAP_TOOLID_MODE:
Debug( LDAP_DEBUG_TRACE,
"%s init: initiated %s.\n",
name, mode == SLAP_TOOL_MODE ? "tool" : "server", 0 );
name, (mode == SLAP_TOOL_MODE || mode == SLAP_TOOLID_MODE) ? "tool" : "server", 0 );
slap_name = name;

View file

@ -396,8 +396,8 @@ extern int slapMode;
#define SLAP_TOOL_MODE 2
#ifdef SLAPD_BDB2
# define SLAP_TIMEDSERVER_MODE 3
# define SLAP_TOOLID_MODE 4
#endif
#define SLAP_TOOLID_MODE 4
/* temporary aliases */
typedef BackendDB Backend;

View file

@ -33,8 +33,6 @@ main( int argc, char **argv )
struct berval bv;
struct berval *vals[2];
ldbm_ignore_nextid_file = 1;
slap_ldif_init( argc, argv, LDIF2ID2CHILDREN, "ldbm", SLAP_TOOL_MODE );
slap_startup(dbnum);

View file

@ -30,9 +30,7 @@ main( int argc, char **argv )
struct berval bv;
struct berval *vals[2];
ldbm_ignore_nextid_file = 1;
slap_ldif_init( argc, argv, LDIF2ID2ENTRY, "ldbm", SLAP_TOOL_MODE );
slap_ldif_init( argc, argv, LDIF2ID2ENTRY, "ldbm", SLAP_TOOLID_MODE );
slap_startup(dbnum);
@ -75,7 +73,7 @@ main( int argc, char **argv )
}
maxid++;
put_nextid( be, maxid ); /* override ldbm_ignore_nextid_file */
put_nextid( be, maxid );
#ifdef SLAP_CLEANUP
ldbm_cache_close( be, db );

View file

@ -30,8 +30,6 @@ main( int argc, char **argv )
struct berval bv;
struct berval *vals[2];
ldbm_ignore_nextid_file = 1;
slap_ldif_init( argc, argv, LDIF2INDEX, "ldbm", SLAP_TOOL_MODE );
attr = attr_normalize( argv[argc - 1] );

View file

@ -50,8 +50,6 @@ main( int argc, char **argv )
struct berval *vals[2];
Avlnode *avltypes = NULL;
ldbm_ignore_nextid_file = 1;
slap_ldif_init( argc, argv, LDIF2LDBM, "ldbm", SLAP_TOOL_MODE );
slap_startup(dbnum);