diff --git a/gdbm-1.8.0-64offset.patch b/gdbm-1.8.0-64offset.patch new file mode 100644 index 0000000..c76dfac --- /dev/null +++ b/gdbm-1.8.0-64offset.patch @@ -0,0 +1,64 @@ +diff -buNr gdbm-1.8.0.orig/falloc.c gdbm-1.8.0/falloc.c +--- gdbm-1.8.0.orig/falloc.c Tue May 18 20:16:06 1999 ++++ gdbm-1.8.0/falloc.c Thu Apr 25 18:20:45 2002 +@@ -180,6 +180,13 @@ + avail_block *new_blk; + int index; + ++ if (dbf->header->avail.count == dbf->header->avail.size) ++ { ++ /* We're kind of stuck here, so we re-split the header in order to ++ avoid crashing. Sigh. */ ++ push_avail_block(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) +@@ -196,12 +203,24 @@ + if (num_bytes != new_el.av_size) _gdbm_fatal (dbf, "read error"); + + /* Add the elements from the new block to the header. */ +- for (index = 0; index < new_blk->count; index++) ++ index = 0; ++ while (index < new_blk->count) ++ { ++ while(index < new_blk->count ++ && dbf->header->avail.count < dbf->header->avail.size) + { + /* With luck, this will merge a lot of blocks! */ + _gdbm_put_av_elem(new_blk->av_table[index], + dbf->header->avail.av_table, +- &dbf->header->avail.count, dbf->coalesce_blocks); ++ &dbf->header->avail.count, TRUE); ++ index++; ++ } ++ if (dbf->header->avail.count == dbf->header->avail.size) ++ { ++ /* We're kind of stuck here, so we re-split the header in order to ++ avoid crashing. Sigh. */ ++ push_avail_block(dbf); ++ } + } + + /* Fix next_block, as well. */ +@@ -210,9 +229,17 @@ + /* We changed the header. */ + dbf->header_changed = TRUE; + +- /* Free the previous avail block. */ ++ /* Free the previous avail block. It is possible that the header table ++ is now FULL, which will cause us to overflow it! */ ++ if (dbf->header->avail.count == dbf->header->avail.size) ++ { ++ /* We're kind of stuck here, so we re-split the header in order to ++ avoid crashing. Sigh. */ ++ push_avail_block(dbf); ++ } ++ + _gdbm_put_av_elem (new_el, dbf->header->avail.av_table, +- &dbf->header->avail.count, dbf->coalesce_blocks); ++ &dbf->header->avail.count, TRUE); + free (new_blk); + } + diff --git a/gdbm.spec b/gdbm.spec index 85bbf4c..03d1faf 100644 --- a/gdbm.spec +++ b/gdbm.spec @@ -3,11 +3,12 @@ Summary: A GNU set of database routines which use extensible hashing. Name: gdbm Version: 1.8.0 -Release: 14 +Release: 17 Source: ftp://ftp.gnu.org/gnu/gdbm-%{version}.tar.gz Patch0: gdbm-1.8.0-jbj.patch Patch1: gdbm-1.8.0-fhs.patch Patch2: gdbm-1.8.0-cflags.patch +Patch3: gdbm-1.8.0-64offset.patch License: GPL URL: http://www.gnu.org/software/gdbm/ Group: System Environment/Libraries @@ -43,8 +44,11 @@ gdbm database library. You'll also need to install the gdbm package. %patch0 -p 1 -b .jbj %patch1 -p 1 -b .fhs %patch2 -p 1 -b .cflags +%patch3 -p1 -b .offset %build +export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" + libtoolize --force --copy aclocal autoreconf @@ -91,6 +95,16 @@ fi rm -rf ${RPM_BUILD_ROOT} %changelog +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Thu Apr 25 2002 Trond Eivind Glomsrød 1.8.0-15 +- Use 64bit offset +- Patch to make the above not break from downsj@downsj.com (#63980) + * Tue Feb 26 2002 Trond Eivind Glomsrød 1.8.0-14 - Rebuild