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
@@ -202,7 +202,7 @@ pop_avail_block (GDBM_FILE dbf)
_gdbm_full_read (dbf, new_blk, new_el.av_size));
if (rc)
{
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
}
@@ -330,7 +330,7 @@ push_avail_block (GDBM_FILE dbf)
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
"%s: error writing avail data: %s",
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
@@ -83,7 +83,7 @@ _gdbm_read_entry (GDBM_FILE dbf, int elem_loc)
"%s: error reading entry: %s",
dbf->name, gdbm_db_strerror (dbf));
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
@@ -167,7 +167,7 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
"%s: error writing key: %s",
dbf->name, gdbm_db_strerror (dbf));
- _gdbm_fatal (dbf, gdbm_strerror (rc));
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
return -1;
}
@@ -179,7 +179,7 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
"%s: error writing content: %s",
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
@@ -195,7 +195,6 @@ _gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
int size;
avail_block *av_stk;
size_t lines;
- int rc;
lines = 4 + dbf->header->avail.count;
if (lines > min_size)
@@ -215,13 +214,9 @@ _gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
break;
}
- 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;
}
@@ -256,7 +251,6 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
int temp;
int size;
avail_block *av_stk;
- int rc;
/* Print the the header avail block. */
fprintf (fp, _("\nheader block\nsize = %d\ncount = %d\n"),
@@ -278,12 +272,9 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
break;
}
- 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
@@ -112,7 +112,7 @@ _gdbm_end_update (GDBM_FILE dbf)
GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
"%s: error writing directory: %s",
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.