detect: reduce failure_fatal to bool to save space

pull/9224/head
Victor Julien 3 years ago
parent fd36459c96
commit 377f2d7e1e

@ -339,7 +339,7 @@ int SigLoadSignatures(DetectEngineCtx *de_ctx, char *sig_file, int sig_file_excl
ret = ProcessSigFiles(de_ctx, sig_file, sig_stat, &good_sigs, &bad_sigs);
if (ret != 0) {
if (de_ctx->failure_fatal == 1) {
if (de_ctx->failure_fatal) {
exit(EXIT_FAILURE);
}
}

@ -2479,9 +2479,11 @@ static DetectEngineCtx *DetectEngineCtxInitReal(enum DetectEngineType type, cons
strlcpy(de_ctx->config_prefix, prefix, sizeof(de_ctx->config_prefix));
}
if (ConfGetBool("engine.init-failure-fatal", (int *)&(de_ctx->failure_fatal)) != 1) {
int failure_fatal = 0;
if (ConfGetBool("engine.init-failure-fatal", (int *)&failure_fatal) != 1) {
SCLogDebug("ConfGetBool could not load the value.");
}
de_ctx->failure_fatal = (failure_fatal == 1);
de_ctx->mpm_matcher = PatternMatchDefaultMatcher();
de_ctx->spm_matcher = SinglePatternMatchDefaultMatcher();

@ -824,7 +824,7 @@ enum DetectEngineType
/** \brief main detection engine ctx */
typedef struct DetectEngineCtx_ {
int failure_fatal;
bool failure_fatal;
int tenant_id;

@ -641,7 +641,7 @@ int SRepInit(DetectEngineCtx *de_ctx)
int r = SRepLoadFile(cidr_ctx, sfile);
if (r < 0){
if (de_ctx->failure_fatal == 1) {
if (de_ctx->failure_fatal) {
exit(EXIT_FAILURE);
}
}

Loading…
Cancel
Save