new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_csyslogd / config.c
old mode 100755 (executable)
new mode 100644 (file)
index 91770e1..122abf5
@@ -1,6 +1,3 @@
-/* @(#) $Id: ./src/os_csyslogd/config.c, 2011/09/08 dcid Exp $
- */
-
 /* Copyright (C) 2009 Trend Micro Inc.
  * All rights reserved.
  *
@@ -8,44 +5,32 @@
  * 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 = config.data;
 
-    syslog_config = gen_config.data;
-
-    return(syslog_config);
+    return (syslog_config);
 }
 
-/* EOF */