From 1888b8a517286225c4ed91b719f0c0019bb835db Mon Sep 17 00:00:00 2001 From: vraatikka Date: Fri, 28 Jun 2013 11:39:00 +0300 Subject: [PATCH] Prevented redefinition of bool, added function void skygw_logmanager_exit(void) to be called by atexit --- log_manager/log_manager.cc | 18 ++++++++++++++++++ log_manager/log_manager.h | 1 + utils/skygw_types.h | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index dc6792c7a..5f8a80350 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -344,6 +344,24 @@ static void logmanager_done_nomutex( } +/** + * @node This function is provided for atexit() system function. + * + * Parameters: + * @param void - + * + * + * @return void + * + * + * @details (write detailed description here) + * + */ +void skygw_logmanager_exit(void) +{ + skygw_logmanager_done(NULL); +} + /** * @node End execution of log manager * diff --git a/log_manager/log_manager.h b/log_manager/log_manager.h index 801b2186e..cadd571ae 100644 --- a/log_manager/log_manager.h +++ b/log_manager/log_manager.h @@ -47,6 +47,7 @@ EXTERN_C_BLOCK_BEGIN bool skygw_logmanager_init(void** ctx, int argc, char* argv[]); void skygw_logmanager_done(void** ctx); +void skygw_logmanager_exit(void); int skygw_log_write(void* ctx, logfile_id_t id, char* str); int skygw_log_flush(logfile_id_t id); int skygw_log_write_flush(void* ctx, logfile_id_t id, char* str); diff --git a/utils/skygw_types.h b/utils/skygw_types.h index 83e108384..99d36a299 100644 --- a/utils/skygw_types.h +++ b/utils/skygw_types.h @@ -42,7 +42,9 @@ #elif !defined(TRUE) && !defined(FALSE) typedef enum {FALSE=0, TRUE} bool; #else -#define bool int +# if !defined(bool) +# define bool int +# endif #endif #endif /* SKYGW_TYPES_H */