aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gdbmdump.c')
-rw-r--r--src/gdbmdump.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gdbmdump.c b/src/gdbmdump.c
index daf6a43..2e6f5b0 100644
--- a/src/gdbmdump.c
+++ b/src/gdbmdump.c
@@ -109,23 +109,29 @@ _gdbm_dump_ascii (GDBM_FILE dbf, FILE *fp)
free (key.dptr);
free (data.dptr);
key = nextkey;
count++;
}
- if (rc == 0 && (rc = gdbm_last_errno (dbf)) == 0)
- {
-
/* FIXME: Something like that won't hurt, although load does not
use it currently. */
fprintf (fp, "#:count=%lu\n", (unsigned long) count);
fprintf (fp, "# End of data\n");
+
+ if (rc == 0)
+ {
+ rc = gdbm_last_errno (dbf);
+ if (rc == GDBM_ITEM_NOT_FOUND)
+ {
+ gdbm_clear_error (dbf);
+ gdbm_errno = GDBM_NO_ERROR;
+ rc = 0;
+ }
}
free (buffer);
-
return rc ? -1 : 0;
}
int
gdbm_dump_to_file (GDBM_FILE dbf, FILE *fp, int format)
{

Return to:

Send suggestions and report system problems to the System administrator.