]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-json: improve hiredis define
authorEric Leblond <eric@regit.org>
Tue, 26 May 2015 20:49:07 +0000 (22:49 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 22 Oct 2015 08:01:05 +0000 (10:01 +0200)
Use #ifdef instead of #if and don't include the header which is
not needed anymore.

src/output-json.c

index eb937c4ef561bc9e34dd43758a3f910c46a456ac..aa803d12fb5d086711de63bb0af4574872652776 100644 (file)
@@ -110,9 +110,6 @@ void OutputJsonRegisterTests (void)
 #else /* implied we do have JSON support */
 
 #include <jansson.h>
-#if HAVE_LIBHIREDIS
-#include <hiredis/hiredis.h>
-#endif
 
 #define DEFAULT_LOG_FILENAME "eve.json"
 #define DEFAULT_ALERT_SYSLOG_FACILITY_STR       "local0"
@@ -503,7 +500,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
             } else if (strcmp(output_s, "unix_stream") == 0) {
                 json_ctx->json_out = LOGFILE_TYPE_UNIX_STREAM;
             } else if (strcmp(output_s, "redis") == 0) {
-#if HAVE_LIBHIREDIS
+#ifdef HAVE_LIBHIREDIS
                 json_ctx->json_out = LOGFILE_TYPE_REDIS;
 #else
                 SCLogError(SC_ERR_INVALID_ARGUMENT,
@@ -582,7 +579,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
             openlog(ident, LOG_PID|LOG_NDELAY, facility);
 
         }
-#if HAVE_LIBHIREDIS
+#ifdef HAVE_LIBHIREDIS
         else if (json_ctx->json_out == LOGFILE_TYPE_REDIS) {
             ConfNode *redis_node = ConfNodeLookupChild(conf, "redis");
             const char *redis_server = NULL;