diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-09 10:18:02 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-09 10:18:02 +0300 |
commit | 0eafbb93c82a489204f54259593f2aaeb9cdbfc4 (patch) | |
tree | e7fad3689d9110d7132ee2fe5f9bdcc2011474ef /compat/dbmopen.c | |
parent | e4d2c56435a23ce1d3a0c06518231f632311de04 (diff) | |
download | gdbm-0eafbb93c82a489204f54259593f2aaeb9cdbfc4.tar.gz |
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/dbmopen.c')
-rw-r--r-- | compat/dbmopen.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |