more fixes for exit on sig init failure

remotes/origin/master-1.0.x
Will Metcalf 16 years ago committed by Victor Julien
parent f2b1e66a6a
commit 23aa6cf642

@ -310,7 +310,13 @@ int SigLoadSignatures (DetectEngineCtx *de_ctx, char *sig_file)
cnt += r; cnt += r;
} else if (r == 0){ } else if (r == 0){
SCLogError(SC_ERR_NO_RULES, "No rules loaded from %s", sfile); SCLogError(SC_ERR_NO_RULES, "No rules loaded from %s", sfile);
ret = -1; if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE);
}
} else if (r < 0){
if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE);
}
} }
free(sfile); free(sfile);
} }
@ -325,12 +331,22 @@ int SigLoadSignatures (DetectEngineCtx *de_ctx, char *sig_file)
cnt += r; cnt += r;
} else if (r == 0) { } else if (r == 0) {
SCLogError(SC_ERR_NO_RULES, "No rules loaded from %s", sig_file); SCLogError(SC_ERR_NO_RULES, "No rules loaded from %s", sig_file);
if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE);
}
} else if (r < 0){
if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE);
}
} }
} }
/* now we should have signatures to work with */ /* now we should have signatures to work with */
if (cnt <= 0) { if (cnt <= 0) {
SCLogError(SC_ERR_NO_RULES_LOADED, "%d rule files specified, but no rule was loaded at all!", cntf); SCLogError(SC_ERR_NO_RULES_LOADED, "%d rule files specified, but no rule was loaded at all!", cntf);
if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE);
}
ret = -1; ret = -1;
} else { } else {
SCLogInfo("%d rules loaded from %d files.", cnt, cntf); SCLogInfo("%d rules loaded from %d files.", cnt, cntf);

Loading…
Cancel
Save