summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org>2018-05-24 05:28:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-05-24 05:29:47 (GMT)
commitf82d0b213fd2cdce80dc891906fba8d589115664 (patch) (side-by-side diff)
tree9aa091d9fbe7fea183391fc9e22fc0f2f54ae28f /src
parent0665bcf0c9cdf756f9d5edc6a638c56602c42065 (diff)
downloadgdbm-f82d0b213fd2cdce80dc891906fba8d589115664.tar.gz
gdbm-f82d0b213fd2cdce80dc891906fba8d589115664.tar.bz2
Fix the use of return code from _gdbm_full_(read|write) functions
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/falloc.c4
-rw-r--r--src/findkey.c2
-rw-r--r--src/gdbmstore.c4
-rw-r--r--src/gdbmtool.c17
-rw-r--r--src/update.c2
5 files changed, 10 insertions, 19 deletions
diff --git a/src/falloc.c b/src/falloc.c
index 33a238a..e87a5b7 100644
--- a/src/falloc.c
+++ b/src/falloc.c
@@ -204,3 +204,3 @@ pop_avail_block (GDBM_FILE dbf)
{
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
@@ -332,3 +332,3 @@ push_avail_block (GDBM_FILE dbf)
dbf->name, gdbm_db_strerror (dbf));
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
diff --git a/src/findkey.c b/src/findkey.c
index 211d9a9..7638b04 100644
--- a/src/findkey.c
+++ b/src/findkey.c
@@ -85,3 +85,3 @@ _gdbm_read_entry (GDBM_FILE dbf, int elem_loc)
dbf->need_recovery = TRUE;
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return NULL;
diff --git a/src/gdbmstore.c b/src/gdbmstore.c
index 0bcd7d7..7b2ed04 100644
--- a/src/gdbmstore.c
+++ b/src/gdbmstore.c
@@ -169,3 +169,3 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
dbf->name, gdbm_db_strerror (dbf));
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
@@ -181,3 +181,3 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
dbf->name, gdbm_db_strerror (dbf));
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index 18d0e10..33bdf93 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -197,3 +197,2 @@ _gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
size_t lines;
- int rc;
@@ -217,9 +216,5 @@ _gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
- if ((rc = _gdbm_full_read (dbf, av_stk, size)))
+ if (_gdbm_full_read (dbf, av_stk, size))
{
- if (rc == GDBM_FILE_EOF)
- terror ("read: %s", gdbm_strerror (rc));
- else
- terror ("read: %s (%s)",
- gdbm_strerror (rc), strerror (errno));
+ terror ("read: %s", gdbm_db_strerror (dbf));
break;
@@ -258,3 +253,2 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
avail_block *av_stk;
- int rc;
@@ -280,8 +274,5 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
- if ((rc = _gdbm_full_read (dbf, av_stk, size)))
+ if (_gdbm_full_read (dbf, av_stk, size))
{
- if (rc == GDBM_FILE_EOF)
- terror ("read: %s", gdbm_strerror (rc));
- else
- terror ("read: %s (%s)", gdbm_strerror (rc), strerror (errno));
+ terror ("read: %s", gdbm_db_strerror (dbf));
break;
diff --git a/src/update.c b/src/update.c
index 905ba69..63c6c95 100644
--- a/src/update.c
+++ b/src/update.c
@@ -114,3 +114,3 @@ _gdbm_end_update (GDBM_FILE dbf)
dbf->name, gdbm_db_strerror (dbf));
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;

Return to:

Send suggestions and report system problems to the System administrator.