comparison src/database.c @ 170:ad4490c377a4 noffle

[svn] Fix bug in last change
author enz
date Wed, 28 Feb 2001 19:01:33 +0000
parents 39838e7d38be
children fed1334d766b
comparison
equal deleted inserted replaced
169:39838e7d38be 170:ad4490c377a4
1 /* 1 /*
2 database.c 2 database.c
3 3
4 $Id: database.c 262 2001-02-28 18:59:00Z enz $ 4 $Id: database.c 263 2001-02-28 19:01:33Z enz $
5 5
6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was 6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was
7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs 7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs
8 (e.g. it is not recommended to delete or overwrite entries with 8 (e.g. it is not recommended to delete or overwrite entries with
9 overflow pages). 9 overflow pages).
626 snprintf( name, MAXCHAR, "%s/data/articles.gdbm", Cfg_spoolDir() ); 626 snprintf( name, MAXCHAR, "%s/data/articles.gdbm", Cfg_spoolDir() );
627 snprintf( tmpName, MAXCHAR, "%s/data/articles.gdbm.new", Cfg_spoolDir() ); 627 snprintf( tmpName, MAXCHAR, "%s/data/articles.gdbm.new", Cfg_spoolDir() );
628 flags = GDBM_NEWDB | GDBM_FAST; 628 flags = GDBM_NEWDB | GDBM_FAST;
629 if ( ! ( tmpDbf = gdbm_open( tmpName, 512, flags, 0644, NULL ) ) ) 629 if ( ! ( tmpDbf = gdbm_open( tmpName, 512, flags, 0644, NULL ) ) )
630 { 630 {
631 Log_err( "Error opening %s for read/write (%s)", name, errMsg() ); 631 Log_err( "Error opening %s for read/write (%s)", tmpName, errMsg() );
632 Db_close(); 632 Db_close();
633 return FALSE; 633 return FALSE;
634 } 634 }
635 Log_inf( "Expiring articles" ); 635 Log_inf( "Expiring articles" );
636 cntDel = 0; 636 cntDel = 0;