From: Eric Leblond Date: Tue, 26 May 2015 20:49:07 +0000 (+0200) Subject: output-json: improve hiredis define X-Git-Tag: suricata-3.0RC1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31c91d53bb0e784fa46fd4c67af75eb453c1d01e;p=thirdparty%2Fsuricata.git output-json: improve hiredis define Use #ifdef instead of #if and don't include the header which is not needed anymore. --- 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;