aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-09 10:18:02 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-07-09 10:18:02 +0300
commit0eafbb93c82a489204f54259593f2aaeb9cdbfc4 (patch)
treee7fad3689d9110d7132ee2fe5f9bdcc2011474ef /compat
parente4d2c56435a23ce1d3a0c06518231f632311de04 (diff)
downloadgdbm-0eafbb93c82a489204f54259593f2aaeb9cdbfc4.tar.gz
gdbm-0eafbb93c82a489204f54259593f2aaeb9cdbfc4.tar.bz2
All gdbm functions return immediately if the DB is in inconsistent sate (needs recovery).
* src/gdbm.h.in (GDBM_NEED_RECOVERY): New error code. * src/gdbmdefs.h (GDBM_ASSERT_CONSISTENCY): New macro. * src/gdbmerrno.c: Update. * src/gdbmopen.c (gdbm_open): Initialize need_recovery and last_error. * src/gdbmcount.c (gdbm_count): Return immediately if the database needs recovery. * src/gdbmdelete.c (gdbm_delete): Likewise. * src/gdbmdump.c (gdbm_dump_to_file, gdbm_dump): Likewise. * src/gdbmexists.c (gdbm_exists): Likewise. * src/gdbmexp.c (gdbm_export_to_file): Likewise. * src/gdbmfetch.c (gdbm_fetch): Likewise. * src/gdbmimp.c (gdbm_import_from_file): Likewise. * src/gdbmreorg.c (gdbm_reorganize): Likewise. * src/gdbmseq.c (gdbm_firstkey): Likewise. * src/gdbmsetopt.c (gdbm_nextkey): Likewise. * src/gdbmstore.c (gdbm_store): Likewise. * src/gdbmsync.c (gdbm_sync): Likewise.
Diffstat (limited to 'compat')
-rw-r--r--compat/dbminit.c2
-rw-r--r--compat/dbmopen.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/compat/dbminit.c b/compat/dbminit.c
index f5c5a65..f5203d1 100644
--- a/compat/dbminit.c
+++ b/compat/dbminit.c
@@ -2,7 +2,7 @@
DBM interface. */
/* This file is part of GDBM, the GNU data base manager.
- Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation,
+ Copyright (C) 1990, 1991, 1993, 2007, 2011, 2016 Free Software Foundation,
Inc.
GDBM is free software; you can redistribute it and/or modify
diff --git a/compat/dbmopen.c b/compat/dbmopen.c
index f8df3e3..af423df 100644
--- a/compat/dbmopen.c
+++ b/compat/dbmopen.c
@@ -2,7 +2,7 @@
NDBM interface for dbm use. */
/* This file is part of GDBM, the GNU data base manager.
- Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation,
+ Copyright (C) 1990, 1991, 1993, 2007, 2011, 2016 Free Software Foundation,
Inc.
GDBM is free software; you can redistribute it and/or modify
@@ -259,7 +259,7 @@ dbm_open (char *file, int flags, int mode)
/* Did we successfully open the file? */
if (dbm->file == NULL)
{
- gdbm_set_errno (dbm, GDBM_FILE_OPEN_ERROR, 1);
+ gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, 1);
free (dbm);
dbm = NULL;
}

Return to:

Send suggestions and report system problems to the System administrator.