summaryrefslogtreecommitdiffabout
path: root/src/recover.c
Unidiff
Diffstat (limited to 'src/recover.c') (more/less context) (show whitespace changes)
-rw-r--r--src/recover.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/recover.c b/src/recover.c
index d6d4ff9..721c23f 100644
--- a/src/recover.c
+++ b/src/recover.c
@@ -312,6 +312,20 @@ run_recovery (GDBM_FILE dbf, GDBM_FILE new_dbf, gdbm_recovery *rcvr, int flags)
312 312
313 if (gdbm_store (new_dbf, key, data, GDBM_INSERT) != 0) 313 if (gdbm_store (new_dbf, key, data, GDBM_INSERT) != 0)
314 { 314 {
315 switch (gdbm_last_errno (new_dbf))
316 {
317 case GDBM_CANNOT_REPLACE:
318 rcvr->duplicate_keys++;
319 if (flags & GDBM_RCVR_ERRFUN)
320 rcvr->errfun (rcvr->data,
321 _("ignoring duplicate key %d:%d (%lu:%d)"),
322 bucket_dir, i,
323 (unsigned long) dbf->bucket->h_table[i].data_pointer,
324 dbf->bucket->h_table[i].key_size
325 + dbf->bucket->h_table[i].data_size);
326 break;
327
328 default:
315 if (flags & GDBM_RCVR_ERRFUN) 329 if (flags & GDBM_RCVR_ERRFUN)
316 rcvr->errfun (rcvr->data, 330 rcvr->errfun (rcvr->data,
317 _("fatal: can't store element %d:%d (%lu:%d): %s"), 331 _("fatal: can't store element %d:%d (%lu:%d): %s"),
@@ -325,6 +339,7 @@ run_recovery (GDBM_FILE dbf, GDBM_FILE new_dbf, gdbm_recovery *rcvr, int flags)
325 } 339 }
326 } 340 }
327 } 341 }
342 }
328 343
329 return 0; 344 return 0;
330} 345}
@@ -356,6 +371,7 @@ gdbm_recover (GDBM_FILE dbf, gdbm_recovery *rcvr, int flags)
356 rcvr->recovered_buckets = 0; 371 rcvr->recovered_buckets = 0;
357 rcvr->failed_keys = 0; 372 rcvr->failed_keys = 0;
358 rcvr->failed_buckets = 0; 373 rcvr->failed_buckets = 0;
374 rcvr->duplicate_keys = 0;
359 rcvr->backup_name = NULL; 375 rcvr->backup_name = NULL;
360 376
361 rc = 0; 377 rc = 0;

Return to:

Send suggestions and report system problems to the System administrator.