int lmax, lcur;
int dbnum;
ID id;
+ ID maxid;
struct dbcache *db;
Backend *be = NULL;
struct ldbminfo *li;
}
id = 0;
+ maxid = 0;
stop = 0;
buf = NULL;
lcur = lmax = 0;
int len;
id++;
+ if ( id > maxid )
+ maxid = id;
key.dptr = (char *) &id;
key.dsize = sizeof(ID);
data.dptr = buf;
}
}
- id++;
- bdb2i_put_nextid( be, id );
+ maxid++;
+ bdb2i_put_nextid( be, maxid );
#ifdef SLAP_CLEANUP
bdb2i_cache_close( be, db );
int lmax, lcur;
int dbnum;
ID id;
+ ID maxid;
DBCache *db;
Backend *be = NULL;
struct ldbminfo *li;
}
id = 0;
+ maxid = 0;
stop = 0;
buf = NULL;
lcur = lmax = 0;
int len;
id++;
+ if ( id > maxid )
+ maxid = id;
key.dptr = (char *) &id;
key.dsize = sizeof(ID);
data.dptr = buf;
slap_shutdown(dbnum);
- id++;
+ maxid++;
sprintf( line, "%s/NEXTID",
((struct ldbminfo *) be->be_private)->li_directory );
if ( (fp = fopen( line, "w" )) == NULL ) {
perror( line );
- fprintf( stderr, "Could not write next id %ld\n", id );
+ fprintf( stderr, "Could not write next id %ld\n", maxid );
} else {
- fprintf( fp, "%ld\n", id );
+ fprintf( fp, "%ld\n", maxid );
fclose( fp );
}