X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Flogging.h;h=486e7926f753522b3c89b365256d60a9f2a8e92c;hb=HEAD;hp=0f5bb42a818f31099104fda7d644cf5a180d67f1;hpb=365913119200189c25ba12bdfedaea8ca4762190;p=monky diff --git a/src/logging.h b/src/logging.h index 0f5bb42..486e792 100644 --- a/src/logging.h +++ b/src/logging.h @@ -1,4 +1,6 @@ -/* Conky, a system monitor, based on torsmo +/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- + * + * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * @@ -7,7 +9,7 @@ * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen - * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. + * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * @@ -25,20 +27,26 @@ * */ -void clean_up(void); +#include "mail.h" + +void clean_up(void *memtofree1, void* memtofree2); +void clean_up_without_threads(void *memtofree1, void* memtofree2); #ifndef _LOGGING_H #define _LOGGING_H -#define ERR(...) { \ +#define NORM_ERR(...) { \ fprintf(stderr, PACKAGE_NAME": "); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ } /* critical error */ -#define CRIT_ERR(...) \ - { ERR(__VA_ARGS__); clean_up(); exit(EXIT_FAILURE); } +#define CRIT_ERR(memtofree1, memtofree2, ...) \ + { NORM_ERR(__VA_ARGS__); clean_up(memtofree1, memtofree2); free(current_mail_spool); exit(EXIT_FAILURE); } + +#define THREAD_CRIT_ERR(memtofree1, memtofree2, ...) \ + { NORM_ERR(__VA_ARGS__); clean_up_without_threads(memtofree1, memtofree2); free(current_mail_spool); return; } /* debugging output */ extern int global_debug_level;