summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-07-10 23:00:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:28:30 -0500
commitd775ad4aba485e00066eef3d1c44929541c4ce61 (patch)
tree5f6ab8ef3a87efa1bafbf043f3ebd9bda25f366a /source3/lib
parent6d0141c17e996cf1c0fb4aa69ab7a1c506657e0d (diff)
downloadsamba-d775ad4aba485e00066eef3d1c44929541c4ce61.tar.gz
samba-d775ad4aba485e00066eef3d1c44929541c4ce61.tar.bz2
samba-d775ad4aba485e00066eef3d1c44929541c4ce61.zip
r23822: Clean some debugging output (as well in content and
amount as in source code formatting...) Michael (This used to be commit 9794b94ebf79686da2e1b3ae343953581e3459a1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_tdb.c53
1 files changed, 19 insertions, 34 deletions
diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c
index 65ecb1759d..c567250a9f 100644
--- a/source3/lib/util_tdb.c
+++ b/source3/lib/util_tdb.c
@@ -1011,34 +1011,22 @@ static int tdb_validate_child(const char *tdb_path,
/* Check if the tdb's freelist is good. */
if (tdb_validate_freelist(tdb, &num_entries) == -1) {
- DEBUG(0,("tdb_validate_child: bad freelist in tdb %s\n",
- tdb_path));
v_status.bad_freelist = True;
v_status.success = False;
goto out;
}
DEBUG(10,("tdb_validate_child: tdb %s freelist has %d entries\n",
- tdb_path, num_entries));
+ tdb_path, num_entries));
/* Now traverse the tdb to validate it. */
num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
if (num_entries == -1 || !(v_status.success)) {
- DEBUG(0,("tdb_validate_child: tdb %s traverse failed\n",
- tdb_path));
- if (!(v_status.success)) {
- if (v_status.bad_entry) {
- DEBUGADD(0, (" -> bad entry found\n"));
- }
- if (v_status.unknown_key) {
- DEBUGADD(0, (" -> unknown key encountered\n"));
- }
- }
goto out;
}
- DEBUG(10,("tdb_validate_child: tdb %s is good "
- "with %d entries\n", tdb_path, num_entries));
+ DEBUG(10,("tdb_validate_child: tdb %s is good with %d entries\n",
+ tdb_path, num_entries));
ret = 0; /* Cache is good. */
out:
@@ -1046,12 +1034,12 @@ out:
tdb_close(tdb);
}
- DEBUG(10, ("tdb_validate_child: summary of validation status:\n"));
- DEBUGADD(10, (" * tdb error: %s\n", v_status.tdb_error ? "yes" : "no"));
- DEBUGADD(10, (" * bad freelist: %s\n", v_status.bad_freelist ? "yes" : "no"));
- DEBUGADD(10, (" * bad entry: %s\n", v_status.bad_entry ? "yes" : "no"));
- DEBUGADD(10, (" * unknown key: %s\n", v_status.unknown_key ? "yes" : "no"));
- DEBUGADD(10, (" => overall success: %s\n", v_status.success ? "yes" : "no"));
+ DEBUG(10, ("tdb_validate_child: summary of validation status:\n"));
+ DEBUGADD(10,(" * tdb error: %s\n", v_status.tdb_error ? "yes" : "no"));
+ DEBUGADD(10,(" * bad freelist: %s\n",v_status.bad_freelist?"yes":"no"));
+ DEBUGADD(10,(" * bad entry: %s\n", v_status.bad_entry ? "yes" : "no"));
+ DEBUGADD(10,(" * unknown key: %s\n", v_status.unknown_key?"yes":"no"));
+ DEBUGADD(10,(" => overall success: %s\n", v_status.success?"yes":"no"));
return ret;
}
@@ -1082,26 +1070,24 @@ int tdb_validate(const char *tdb_path, tdb_validate_data_func validate_fn)
/* parent */
- DEBUG(10, ("tdb_validate: fork succeeded, child PID = %d\n",
- child_pid));
+ DEBUG(10, ("tdb_validate: fork succeeded, child PID = %d\n",child_pid));
DEBUG(10, ("tdb_validate: waiting for child to finish...\n"));
while ((wait_pid = sys_waitpid(child_pid, &child_status, 0)) < 0) {
if (errno == EINTR) {
- DEBUG(10, ("tdb_validate: got signal during "
- "waitpid, retrying\n"));
+ DEBUG(10, ("tdb_validate: got signal during waitpid, "
+ "retrying\n"));
errno = 0;
continue;
}
- DEBUG(0, ("tdb_validate: waitpid failed with "
- "errno %s\n", strerror(errno)));
+ DEBUG(0, ("tdb_validate: waitpid failed with errno %s\n",
+ strerror(errno)));
smb_panic("tdb_validate: waitpid failed.");
}
if (wait_pid != child_pid) {
DEBUG(0, ("tdb_validate: waitpid returned pid %d, "
- "but %d was expexted\n", wait_pid, child_pid));
- smb_panic("tdb_validate: waitpid returned "
- "unexpected PID.");
+ "but %d was expected\n", wait_pid, child_pid));
+ smb_panic("tdb_validate: waitpid returned unexpected PID.");
}
DEBUG(10, ("tdb_validate: validating child returned.\n"));
@@ -1111,8 +1097,8 @@ int tdb_validate(const char *tdb_path, tdb_validate_data_func validate_fn)
ret = WEXITSTATUS(child_status);
}
if (WIFSIGNALED(child_status)) {
- DEBUG(10, ("tdb_validate: child terminated "
- "by signal %d\n", WTERMSIG(child_status)));
+ DEBUG(10, ("tdb_validate: child terminated by signal %d\n",
+ WTERMSIG(child_status)));
#ifdef WCOREDUMP
if (WCOREDUMP(child_status)) {
DEBUGADD(10, ("core dumped\n"));
@@ -1121,8 +1107,7 @@ int tdb_validate(const char *tdb_path, tdb_validate_data_func validate_fn)
ret = WTERMSIG(child_status);
}
if (WIFSTOPPED(child_status)) {
- DEBUG(10, ("tdb_validate: child was stopped "
- "by signal %d\n",
+ DEBUG(10, ("tdb_validate: child was stopped by signal %d\n",
WSTOPSIG(child_status)));
ret = WSTOPSIG(child_status);
}