Mercurial > noffle
diff src/filter.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 | 0340b9c17edc |
| children | 21300895412f |
line wrap: on
line diff
--- a/src/filter.c Tue Dec 24 09:08:59 2002 +0000 +++ b/src/filter.c Fri Dec 27 21:48:25 2002 +0000 @@ -3,7 +3,7 @@ Article filtering. - $Id: filter.c 381 2002-05-14 14:25:45Z mirkol $ + $Id: filter.c 413 2002-12-27 21:48:25Z bears $ */ #if HAVE_CONFIG_H @@ -220,10 +220,7 @@ ( filter.maxFilters + 5 ) * sizeof( Filter * ) ); if ( filter.filters == NULL ) - { - Log_err( "Could not realloc filter list" ); - exit( EXIT_FAILURE ); - } + Log_fatal( "Could not realloc filter list" ); filter.maxFilters += 5; } filter.filters[ filter.nFilters++ ] = f; @@ -348,10 +345,7 @@ Filter *f; if ( ! ( f = ( Filter * ) malloc( sizeof( Filter ) ) ) ) - { - Log_err( "Cannot allocate Filter" ); - exit( EXIT_FAILURE ); - } + Log_fatal( "Cannot allocate Filter" ); f->nRules = 0; f->maxRules = 0; f->rules = NULL; @@ -421,10 +415,7 @@ * sizeof( FilterRule ) ); if ( f->rules == NULL ) - { - Log_err( "Could not realloc rule list" ); - exit( EXIT_FAILURE ); - } + Log_fatal( "Could not realloc rule list" ); f->maxRules += 5; } f->rules[ f->nRules++ ] = rule;
