aboutsummaryrefslogtreecommitdiff
path: root/src/bucket.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-09 08:40:04 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-07-09 08:47:16 +0300
commit479a469033903a76b9c073806037dd66176f3da0 (patch)
tree2841b611288f9343868e6ded82909b096a62e121 /src/bucket.c
parent2efd8358711ab3ea6c0ecaab75d195837b4b3e37 (diff)
downloadgdbm-479a469033903a76b9c073806037dd66176f3da0.tar.gz
gdbm-479a469033903a76b9c073806037dd66176f3da0.tar.bz2
Per-database error state.
Last error code is stored in the database file structure as well as in the global gdbm_errno. Special functions are provided for retrieving and clearing the last error state. * src/gdbmdefs.h (gdbm_file_info): New member: last_error * src/gdbm.h.in (gdbm_last_errno, gdbm_set_errno) (gdbm_clear_error): New protos. * src/gdbmerrno.c (gdbm_last_errno, gdbm_set_errno) (gdbm_clear_error): New functions * NEWS: Update. * compat/dbminit.c: Use gdbm_set_errno to set error state. * compat/dbmopen.c: Likewise. * src/bucket.c: Likewise. * src/findkey.c: Likewise. * src/gdbm_load.c: Likewise. * src/gdbmcount.c: Likewise. * src/gdbmdelete.c: Likewise. * src/gdbmdump.c: Likewise. * src/gdbmexists.c: Likewise. * src/gdbmexp.c: Likewise. * src/gdbmfetch.c: Likewise. * src/gdbmimp.c: Likewise. * src/gdbmload.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmreorg.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmsetopt.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmsync.c: Likewise. * src/mmap.c: Likewise.
Diffstat (limited to 'src/bucket.c')
-rw-r--r--src/bucket.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bucket.c b/src/bucket.c
index c9a951c..ee0e157 100644
--- a/src/bucket.c
+++ b/src/bucket.c
@@ -1,8 +1,8 @@
/* bucket.c - The routines for playing with hash buckets. */
/* This file is part of GDBM, the GNU data base manager.
- Copyright (C) 1990, 1991, 1993, 2007, 2011, 2013 Free Software Foundation,
- Inc.
+ Copyright (C) 1990, 1991, 1993, 2007, 2011, 2013,
+ 2016 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -131,13 +131,13 @@ _gdbm_read_bucket_at (GDBM_FILE dbf, off_t off, hash_bucket *bucket,
file_pos = __lseek (dbf, off, SEEK_SET);
if (file_pos != off)
{
- gdbm_errno = GDBM_FILE_SEEK_ERROR;
+ gdbm_set_errno (dbf, GDBM_FILE_SEEK_ERROR, 1);
return -1;
}
rc = _gdbm_full_read (dbf, bucket, size);
if (rc)
{
- gdbm_errno = rc;
+ gdbm_set_errno (dbf, rc, 1);
return -1;
}
return 0;

Return to:

Send suggestions and report system problems to the System administrator.