comparison src/group.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 94b7962a0fbe
children ff7a2dc6023e
comparison
equal deleted inserted replaced
280:9c54bf672ca1 281:5eece4dfd945
5 the groups we know of. One database record is cached in the global struct 5 the groups we know of. One database record is cached in the global struct
6 grp. Group information is transfered between the grp and the database by 6 grp. Group information is transfered between the grp and the database by
7 loadGrp() and saveGrp(). This is done transparently. Access to the groups 7 loadGrp() and saveGrp(). This is done transparently. Access to the groups
8 database is done by group name, by the functions defined in group.h. 8 database is done by group name, by the functions defined in group.h.
9 9
10 $Id: group.c 396 2002-08-05 22:05:02Z bears $ 10 $Id: group.c 413 2002-12-27 21:48:25Z bears $
11 */ 11 */
12 12
13 #if HAVE_CONFIG_H 13 #if HAVE_CONFIG_H
14 #include <config.h> 14 #include <config.h>
15 #endif 15 #endif
98 int flags; 98 int flags;
99 99
100 ASSERT( grp.dbf == NULL ); 100 ASSERT( grp.dbf == NULL );
101 snprintf( name, MAXCHAR, "%s/data/groupinfo.gdbm", Cfg_spoolDir() ); 101 snprintf( name, MAXCHAR, "%s/data/groupinfo.gdbm", Cfg_spoolDir() );
102 flags = GDBM_WRCREAT | GDBM_FAST; 102 flags = GDBM_WRCREAT | GDBM_FAST;
103 if ( ! ( grp.dbf = gdbm_open( name, 512, flags, 0644, NULL ) ) ) 103 if ( ! ( grp.dbf = gdbm_open( name, 512, flags, 0644, Log_gdbm_fatal ) ) )
104 { 104 {
105 Log_err( "Error opening %s for r/w (%s)", errMsg() ); 105 Log_err( "Error opening %s for r/w (%s)", errMsg() );
106 return FALSE; 106 return FALSE;
107 } 107 }
108 Log_dbg( LOG_DBG_NEWSBASE, "%s opened for r/w", name ); 108 Log_dbg( LOG_DBG_NEWSBASE, "%s opened for r/w", name );