forked from levonet/docker-rsyslog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrok-missing-semicolon-in-grammar-file.diff
46 lines (42 loc) · 1.43 KB
/
grok-missing-semicolon-in-grammar-file.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/conf.y b/conf.y
index 301d3d8..371a8fe 100644
--- a/conf.y
+++ b/conf.y
@@ -1,13 +1,15 @@
+%code requires{
+#include "grok_config.h"
+}
+
%{
#include <stdio.h>
#include <string.h>
#include "conf.tab.h"
-#include "grok_config.h"
#include "grok_input.h"
#include "grok_matchconf.h"
-int yylineno;
void yyerror (YYLTYPE *loc, struct config *conf, char const *s) {
fprintf (stderr, "Syntax error: %s\n", s);
}
@@ -128,7 +130,7 @@ match_block: match_block match_block_statement
| match_block_statement
match_block_statement: /* empty */
- | "pattern" ':' QUOTEDSTRING { conf_new_match_pattern(conf, $3) }
+ | "pattern" ':' QUOTEDSTRING { conf_new_match_pattern(conf, $3); }
| "reaction" ':' QUOTEDSTRING { CURMATCH.reaction = $3; }
| "reaction" ':' "none" { CURMATCH.no_reaction = 1; }
| "shell" ':' QUOTEDSTRING { CURMATCH.shell = $3; }
diff --git a/grok_config.h b/grok_config.h
index 0eca357..dcfe44b 100644
--- a/grok_config.h
+++ b/grok_config.h
@@ -1,3 +1,5 @@
+#ifndef GROK_CONFIG_H
+#define GROK_CONFIG_H
#include "grok_program.h"
#define CURPROGRAM (conf->programs[conf->nprograms - 1])
@@ -27,3 +29,4 @@ void conf_new_input_file(struct config *conf, char *filename);
void conf_new_matchconf(struct config *conf);
void conf_new_match_pattern(struct config *conf, const char *pattern);
void conf_match_set_debug(struct config *conf, int logmask);
+#endif