[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

makendbm minor, but NASTY, error


BEWARE! makendbm has a minor error that smacks you upside the head if
config.h has both HAVE_NDBM_H and HAVE_DB_H.  The error causes the
database file (the one that has all your data in it) to be truncated.

That's because makedbm calls dbm_open() for the NDBM support(which creates
the empty .pag and .dir files) and then procedes to call dbopen() for the
BTREE support (which creams the input file).

Diff follows...

--- makendbm.c  Sun Apr  6 15:53:50 1997
+++ makendbm.c.orig     Sun Apr  6 14:09:39 1997
@@ -221,7 +221,7 @@
 #ifdef HAVE_DB_H
-	if (typ == 3) {
+	if (typ == 1) {
	dbfile = dbopen(dbasename, O_RDWR|O_CREAT|O_TRUNC, 0644,
	dbf = dbfile;


Tim DiLauro                          Milton S. Eisenhower Library
Library Systems Jack                 Johns Hopkins University
(410) 516-5263                       3400 N. Charles Street
timmo@jhu.edu                        Baltimore, MD  21218