mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
Removed #ifdef TDB_DEBUG around tdb_dump_all() and tdb_printfreelist()
so that tdbtool can be compiled without having to make clean. (This used to be commit dad688d8c6b3c98173a846ad833599a4016d2e1a)
This commit is contained in:
parent
55dfb66079
commit
e91226daea
@ -394,7 +394,6 @@ static int update_tailer(TDB_CONTEXT *tdb, tdb_off offset,
|
||||
&totalsize);
|
||||
}
|
||||
|
||||
#ifdef TDB_DEBUG
|
||||
static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset)
|
||||
{
|
||||
struct list_struct rec;
|
||||
@ -444,7 +443,6 @@ static void tdb_dump_chain(TDB_CONTEXT *tdb, int i)
|
||||
|
||||
void tdb_dump_all(TDB_CONTEXT *tdb)
|
||||
{
|
||||
tdb_off off;
|
||||
int i;
|
||||
for (i=0;i<tdb->header.hash_size;i++) {
|
||||
tdb_dump_chain(tdb, i);
|
||||
@ -457,7 +455,7 @@ void tdb_printfreelist(TDB_CONTEXT *tdb)
|
||||
{
|
||||
long total_free = 0;
|
||||
tdb_off offset, rec_ptr, last_ptr;
|
||||
struct list_struct rec, lastrec, newrec;
|
||||
struct list_struct rec;
|
||||
|
||||
tdb_lock(tdb, -1, F_WRLCK);
|
||||
|
||||
@ -486,11 +484,11 @@ void tdb_printfreelist(TDB_CONTEXT *tdb)
|
||||
/* move to the next record */
|
||||
rec_ptr = rec.next;
|
||||
}
|
||||
printf("total rec_len = [0x%08x (%d)]\n", total_free, total_free );
|
||||
printf("total rec_len = [0x%08x (%d)]\n", (int)total_free,
|
||||
(int)total_free);
|
||||
|
||||
tdb_unlock(tdb, -1, F_WRLCK);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Remove an element from the freelist. Must have alloc lock. */
|
||||
static int remove_from_freelist(TDB_CONTEXT *tdb, tdb_off off, tdb_off next)
|
||||
|
@ -113,13 +113,9 @@ tdbtool:
|
||||
store key data : store a record (replace)
|
||||
show key : show a record by key
|
||||
delete key : delete a record by key
|
||||
"
|
||||
#ifdef TDB_DEBUG
|
||||
" list : print the database hash table and freelist
|
||||
list : print the database hash table and freelist
|
||||
free : print the database freelist
|
||||
"
|
||||
#endif
|
||||
" 1 | first : print the first record
|
||||
1 | first : print the first record
|
||||
n | next : print the next record
|
||||
q | quit : terminate
|
||||
\\n : repeat 'next' command
|
||||
@ -436,12 +432,10 @@ int main(int argc, char *argv[])
|
||||
} else if (strcmp(tok,"dump") == 0) {
|
||||
bIterate = 0;
|
||||
tdb_traverse(tdb, print_rec, NULL);
|
||||
#ifdef TDB_DEBUG
|
||||
} else if (strcmp(tok,"list") == 0) {
|
||||
tdb_dump_all(tdb);
|
||||
} else if (strcmp(tok, "free") == 0) {
|
||||
tdb_printfreelist(tdb);
|
||||
#endif
|
||||
} else if (strcmp(tok,"info") == 0) {
|
||||
info_tdb();
|
||||
} else if ( (strcmp(tok, "1") == 0) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user