diff src/database.c @ 281:5eece4dfd945 noffle

[svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors and exiting, Log_gdbm_fatal() for the the same but specifically as a GDBM error reporting function, and a new log debug level AUTH for a forthcoming authentication mechanism. * src/database.c,src/group.c: Provide new gdbm error function to all gdbm opens. * src/noffle.c: Add atexit() to always close databases on a program- inspired exit. * src/content.c,src/dynamicstring.c,src/fetchlist.c,src/filter.c, src/itemlist.c,src/log.c,src/log.h,src/over.c,src/protocol.h, src/request.c,src/util.c: Use Log_fatal where appropriate.
author bears
date Fri, 27 Dec 2002 21:48:25 +0000
parents 16dad3488e9d
children baa6408d1bbc
line wrap: on
line diff
--- a/src/database.c	Tue Dec 24 09:08:59 2002 +0000
+++ b/src/database.c	Fri Dec 27 21:48:25 2002 +0000
@@ -1,7 +1,7 @@
 /*
   database.c
 
-  $Id: database.c 408 2002-11-10 18:31:25Z bears $
+  $Id: database.c 413 2002-12-27 21:48:25Z bears $
 
   Uses GNU gdbm library. Using Berkeley db (included in libc6) was
   cumbersome. It is based on Berkeley db 1.85, which has severe bugs
@@ -79,7 +79,7 @@
     snprintf( name, MAXCHAR, ARTICLE_FILENAME_FMT, Cfg_spoolDir() );
     flags = GDBM_WRCREAT | GDBM_FAST;
 
-    if ( ! ( db.dbf = gdbm_open( name, 512, flags, 0644, NULL ) ) )
+    if ( ! ( db.dbf = gdbm_open( name, 512, flags, 0644, Log_gdbm_fatal ) ) )
     {
         Log_err( "Error opening %s for r/w (%s)", name, errMsg() );
         return FALSE;
@@ -625,7 +625,7 @@
     snprintf( name, MAXCHAR, ARTICLE_NEW_FILENAME_FMT, Cfg_spoolDir() );
     flags = GDBM_WRCREAT | GDBM_FAST;
 
-    if ( ! ( dbNew.dbf = gdbm_open( name, 512, flags, 0644, NULL ) ) )
+    if ( ! ( dbNew.dbf = gdbm_open( name, 512, flags, 0644, Log_gdbm_fatal ) ) )
     {
         Log_err( "Error opening %s for r/w (%s)", name, errMsg() );
         return FALSE;