-/* @(#) $Id$ */
-
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* and/or modify it under the terms of the GNU General Public
* License (version 2) as published by the FSF - Free Software
* Foundation.
- *
- * License details at the LICENSE file included with OSSEC or
- * online at: http://www.ossec.net/en/licensing.html
*/
-
#include "csyslogd.h"
#include "config/global-config.h"
#include "config/config.h"
-/** void *OS_SyslogConf(int test_config, char *cfgfile,
- SyslogConfig **syslog_config)
- * Reads configuration.
- */
-void *OS_ReadSyslogConf(int test_config, char *cfgfile,
- SyslogConfig **syslog_config)
+/* Read configuration */
+SyslogConfig **OS_ReadSyslogConf(__attribute__((unused)) int test_config, const char *cfgfile)
{
int modules = 0;
- GeneralConfig gen_config;
-
+ struct SyslogConfig_holder config;
+ SyslogConfig **syslog_config = NULL;
/* Modules for the configuration */
- modules|= CSYSLOGD;
- gen_config.data = syslog_config;
+ modules |= CSYSLOGD;
+ config.data = syslog_config;
-
- /* Reading configuration */
- if(ReadConfig(modules, cfgfile, &gen_config, NULL) < 0)
- {
+ /* Read configuration */
+ if (ReadConfig(modules, cfgfile, &config, NULL) < 0) {
ErrorExit(CONFIG_ERROR, ARGV0, cfgfile);
- return(NULL);
- }
+ return (NULL);
+ }
-
- syslog_config = gen_config.data;
+ syslog_config = config.data;
- return(syslog_config);
+ return (syslog_config);
}
-/* EOF */