summaryrefslogtreecommitdiffabout
path: root/src/recover.c
Unidiff
Diffstat (limited to 'src/recover.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/recover.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/recover.c b/src/recover.c
index d6d4ff9..721c23f 100644
--- a/src/recover.c
+++ b/src/recover.c
@@ -314,11 +314,26 @@ run_recovery (GDBM_FILE dbf, GDBM_FILE new_dbf, gdbm_recovery *rcvr, int flags)
314 { 314 {
315 if (flags & GDBM_RCVR_ERRFUN) 315 switch (gdbm_last_errno (new_dbf))
316 rcvr->errfun (rcvr->data, 316 {
317 _("fatal: can't store element %d:%d (%lu:%d): %s"), 317 case GDBM_CANNOT_REPLACE:
318 bucket_dir, i, 318 rcvr->duplicate_keys++;
319 (unsigned long) dbf->bucket->h_table[i].data_pointer, 319 if (flags & GDBM_RCVR_ERRFUN)
320 dbf->bucket->h_table[i].key_size 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:
329 if (flags & GDBM_RCVR_ERRFUN)
330 rcvr->errfun (rcvr->data,
331 _("fatal: can't store element %d:%d (%lu:%d): %s"),
332 bucket_dir, i,
333 (unsigned long) dbf->bucket->h_table[i].data_pointer,
334 dbf->bucket->h_table[i].key_size
321 + dbf->bucket->h_table[i].data_size, 335 + dbf->bucket->h_table[i].data_size,
322 gdbm_db_strerror (new_dbf)); 336 gdbm_db_strerror (new_dbf));
323 return -1; 337 return -1;
338 }
324 } 339 }
@@ -358,2 +373,3 @@ gdbm_recover (GDBM_FILE dbf, gdbm_recovery *rcvr, int flags)
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;

Return to:

Send suggestions and report system problems to the System administrator.