From 31c91d53bb0e784fa46fd4c67af75eb453c1d01e Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 26 May 2015 22:49:07 +0200 Subject: [PATCH] output-json: improve hiredis define Use #ifdef instead of #if and don't include the header which is not needed anymore. --- src/output-json.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/output-json.c b/src/output-json.c index eb937c4ef5..aa803d12fb 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -110,9 +110,6 @@ void OutputJsonRegisterTests (void) #else /* implied we do have JSON support */ #include -#if HAVE_LIBHIREDIS -#include -#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;