summaryrefslogtreecommitdiffabout
path: root/src
Side-by-side diff
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
@@ -199,13 +199,13 @@ pop_avail_block (GDBM_FILE dbf)
}
rc = GDBM_DEBUG_OVERRIDE ("pop_avail_block:read-failure",
_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;
}
if (!gdbm_avail_block_valid_p (new_blk))
{
gdbm_set_errno (dbf, GDBM_BAD_AVAIL, TRUE);
@@ -327,13 +327,13 @@ push_avail_block (GDBM_FILE dbf)
_gdbm_full_write (dbf, temp, av_size));
if (rc)
{
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;
}
free (temp);
return 0;
diff --git a/src/findkey.c b/src/findkey.c
index 211d9a9..7638b04 100644
--- a/src/findkey.c
+++ b/src/findkey.c
@@ -80,13 +80,13 @@ _gdbm_read_entry (GDBM_FILE dbf, int elem_loc)
if (rc)
{
GDBM_DEBUG (GDBM_DEBUG_ERR|GDBM_DEBUG_LOOKUP|GDBM_DEBUG_READ,
"%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;
}
return data_ca->dptr;
}
diff --git a/src/gdbmstore.c b/src/gdbmstore.c
index 0bcd7d7..7b2ed04 100644
--- a/src/gdbmstore.c
+++ b/src/gdbmstore.c
@@ -164,25 +164,25 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
_gdbm_full_write (dbf, key.dptr, key.dsize));
if (rc)
{
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;
}
rc = GDBM_DEBUG_OVERRIDE ("gdbm_store:write-2-failure",
_gdbm_full_write (dbf,
content.dptr, content.dsize));
if (rc)
{
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;
}
/* Current bucket has changed. */
dbf->cache_entry->ca_changed = TRUE;
dbf->bucket_changed = TRUE;
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index 18d0e10..33bdf93 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -192,13 +192,12 @@ size_t
_gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
{
int temp;
int size;
avail_block *av_stk;
size_t lines;
- int rc;
lines = 4 + dbf->header->avail.count;
if (lines > min_size)
return lines;
/* Initialize the variables for a pass throught the avail stack. */
temp = dbf->header->avail.next_block;
@@ -212,19 +211,15 @@ _gdbm_avail_list_size (GDBM_FILE dbf, size_t min_size)
if (__lseek (dbf, temp, SEEK_SET) != temp)
{
terror ("lseek: %s", strerror (errno));
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;
}
if (gdbm_avail_block_valid_p (av_stk))
{
lines += av_stk->count;
@@ -253,13 +248,12 @@ av_table_display (avail_elem *av_table, int count, FILE *fp)
void
_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"),
dbf->header->avail.size, dbf->header->avail.count);
av_table_display (dbf->header->avail.av_table, dbf->header->avail.count, fp);
@@ -275,18 +269,15 @@ _gdbm_print_avail_list (FILE *fp, GDBM_FILE dbf)
if (__lseek (dbf, temp, SEEK_SET) != temp)
{
terror ("lseek: %s", strerror (errno));
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;
}
/* Print the block! */
fprintf (fp, _("\nblock = %d\nsize = %d\ncount = %d\n"), temp,
av_stk->size, av_stk->count);
diff --git a/src/update.c b/src/update.c
index 905ba69..63c6c95 100644
--- a/src/update.c
+++ b/src/update.c
@@ -109,13 +109,13 @@ _gdbm_end_update (GDBM_FILE dbf)
_gdbm_full_write (dbf, dbf->dir, dbf->header->dir_size));
if (rc)
{
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;
}
dbf->directory_changed = FALSE;
if (!dbf->header_changed && dbf->fast_write == FALSE)
__fsync (dbf);

Return to:

Send suggestions and report system problems to the System administrator.