summaryrefslogtreecommitdiffabout
path: root/src/gdbmtool.c
Side-by-side diff
Diffstat (limited to 'src/gdbmtool.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gdbmtool.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index 33bdf93..9c6eebe 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -554,3 +554,3 @@ err_printer (void *data GDBM_ARG_UNUSED, char const *fmt, ...)
-/* recover verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */
+/* recover sumamry verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */
void
@@ -563,4 +563,5 @@ recover_handler (struct handler_param *param)
char *p;
+ int summary = 0;
- for (i = 1; i < param->argc; i++)
+ for (i = 0; i < param->argc; i++)
{
@@ -572,2 +573,6 @@ recover_handler (struct handler_param *param)
}
+ else if (strcmp (arg, "summary") == 0)
+ {
+ summary = 1;
+ }
else if (strcmp (arg, "backup") == 0)
@@ -619,2 +624,15 @@ recover_handler (struct handler_param *param)
fprintf (param->fp, _("Recovery succeeded.\n"));
+ if (summary)
+ {
+ fprintf (param->fp,
+ _("Keys recovered: %lu, failed: %lu, duplicate: %lu\n"),
+ (unsigned long) rcvr.recovered_keys,
+ (unsigned long) rcvr.failed_keys,
+ (unsigned long) rcvr.duplicate_keys);
+ fprintf (param->fp,
+ _("Buckets recovered: %lu, failed: %lu\n"),
+ (unsigned long) rcvr.recovered_buckets,
+ (unsigned long) rcvr.failed_buckets);
+ }
+
if (rcvr.backup_name)
@@ -927,3 +945,3 @@ export_handler (struct handler_param *param)
- for (i = 1; i < param->argc; i++)
+ for (i = 0; i < param->argc; i++)
{
@@ -961,3 +979,3 @@ import_handler (struct handler_param *param)
- for (i = 1; i < param->argc; i++)
+ for (i = 0; i < param->argc; i++)
{
@@ -1222,2 +1240,3 @@ struct command command_tab[] = {
{ { "[verbose]", GDBM_ARG_STRING },
+ { "[summary]", GDBM_ARG_STRING },
{ "[backup]", GDBM_ARG_STRING },

Return to:

Send suggestions and report system problems to the System administrator.