diff options
Diffstat (limited to 'src/falloc.c')
-rw-r--r-- | src/falloc.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/falloc.c b/src/falloc.c index c3bd145..13ee0ed 100644 --- a/src/falloc.c +++ b/src/falloc.c @@ -179,34 +179,31 @@ pop_avail_block (GDBM_FILE dbf) /* Set up variables. */ new_el.av_adr = dbf->header->avail.next_block; new_el.av_size = ( ( (dbf->header->avail.size * sizeof (avail_elem)) >> 1) + sizeof (avail_block)); /* Allocate space for the block. */ - new_blk = GDBM_DEBUG_ALLOC ("pop_avail_block:malloc-failure", - malloc (new_el.av_size)); + new_blk = malloc (new_el.av_size); if (new_blk == NULL) { GDBM_SET_ERRNO (dbf, GDBM_MALLOC_ERROR, TRUE); _gdbm_fatal (dbf, _("malloc failed")); return -1; } /* Read the block. */ - file_pos = GDBM_DEBUG_OVERRIDE ("pop_avail_block:lseek-failure", - __lseek (dbf, new_el.av_adr, SEEK_SET)); + file_pos = __lseek (dbf, new_el.av_adr, SEEK_SET); if (file_pos != new_el.av_adr) { GDBM_SET_ERRNO (dbf, GDBM_FILE_SEEK_ERROR, TRUE); free (new_blk); _gdbm_fatal (dbf, _("lseek error")); return -1; } - rc = GDBM_DEBUG_OVERRIDE ("pop_avail_block:read-failure", - _gdbm_full_read (dbf, new_blk, new_el.av_size)); + rc = _gdbm_full_read (dbf, new_blk, new_el.av_size); if (rc) { free (new_blk); _gdbm_fatal (dbf, gdbm_db_strerror (dbf)); return -1; } @@ -292,14 +289,13 @@ push_avail_block (GDBM_FILE dbf) &dbf->header->avail.count); if (new_loc.av_size == 0) new_loc = get_block (av_size, dbf); av_adr = new_loc.av_adr; /* Split the header block. */ - temp = GDBM_DEBUG_ALLOC ("push_avail_block:malloc-failure", - malloc (av_size)); + temp = malloc (av_size); if (temp == NULL) { GDBM_SET_ERRNO (dbf, GDBM_MALLOC_ERROR, TRUE); _gdbm_fatal (dbf, _("malloc error")); return -1; } @@ -322,23 +318,21 @@ push_avail_block (GDBM_FILE dbf) /* Free the unneeded space. */ new_loc.av_adr += av_size; new_loc.av_size -= av_size; _gdbm_free (dbf, new_loc.av_adr, new_loc.av_size); /* Update the disk. */ - file_pos = GDBM_DEBUG_OVERRIDE ("push_avail_block:lseek-failure", - __lseek (dbf, av_adr, SEEK_SET)); + file_pos = __lseek (dbf, av_adr, SEEK_SET); if (file_pos != av_adr) { GDBM_SET_ERRNO (dbf, GDBM_FILE_SEEK_ERROR, TRUE); _gdbm_fatal (dbf, _("lseek error")); return -1; } - rc = GDBM_DEBUG_OVERRIDE ("push_avail_block:write-failure", - _gdbm_full_write (dbf, temp, av_size)); + rc = _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_db_strerror (dbf)); |