summaryrefslogtreecommitdiffabout
path: root/src/gdbmstore.c
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-26 07:43:34 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-07-26 07:43:34 (GMT)
commit7fb0d1cbbf7842f2632b7dca0451d6f3918dd7ab (patch) (side-by-side diff)
tree899bdcd5c62eb632de6fb3c660a192c1929446c9 /src/gdbmstore.c
parent465e893bfa0cdfb8f260500599fc3af458047a76 (diff)
downloadgdbm-7fb0d1cbbf7842f2632b7dca0451d6f3918dd7ab.tar.gz
gdbm-7fb0d1cbbf7842f2632b7dca0451d6f3918dd7ab.tar.bz2
Fix remaining uses of gdbm_set_errno function.
Use the GDBM_SET_ERRNO and GDBM_SET_ERRNO2 macros to make sure the error gets reported in debug output. * src/fullio.c (_gdbm_full_read) (_gdbm_full_write): Return -1 and set gdbm_errno on error. * src/bucket.c: Use GDBM_SET_ERRNO(2?) or GDBM_DEBUG where necessary. * src/falloc.c: Likewise. * src/findkey.c: Likewise. * src/gdbmdefs.h: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmstore.c: Likewise. * src/mmap.c: Likewise. * src/recover.c: Likewise. * src/update.c: Likewise.
Diffstat (limited to 'src/gdbmstore.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gdbmstore.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gdbmstore.c b/src/gdbmstore.c
index 4cd7ad1..404687c 100644
--- a/src/gdbmstore.c
+++ b/src/gdbmstore.c
@@ -165,8 +165,8 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
if (rc)
{
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
- "%s: writing key: %s", dbf->name, strerror (errno));
- gdbm_set_errno (dbf, rc, TRUE);
+ "%s: error writing key: %s",
+ dbf->name, gdbm_db_strerror (dbf));
_gdbm_fatal (dbf, gdbm_strerror (rc));
return -1;
}
@@ -177,9 +177,8 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
if (rc)
{
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
- "%s: writing content: %s",
- dbf->name, strerror (errno));
- gdbm_set_errno (dbf, rc, TRUE);
+ "%s: error writing content: %s",
+ dbf->name, gdbm_db_strerror (dbf));
_gdbm_fatal (dbf, gdbm_strerror (rc));
return -1;
}

Return to:

Send suggestions and report system problems to the System administrator.