summaryrefslogtreecommitdiff
path: root/bpf_parser.y
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-11-10 10:53:33 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-11-10 10:02:40 +0100
commit642906d31fccd6242b381fc1374de6035d7fbd4e (patch)
tree21a303696ece8f00d37fd22772030352f4ec1b51 /bpf_parser.y
parent84bf18621169ff4292707bcdcfa0552825757f60 (diff)
bpfc, trafgen: Do not close stdin when "-" is specified
Do not perform fclose for stdin fd. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'bpf_parser.y')
-rw-r--r--bpf_parser.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/bpf_parser.y b/bpf_parser.y
index 26ec125..0959f3d 100644
--- a/bpf_parser.y
+++ b/bpf_parser.y
@@ -812,7 +812,9 @@ int compile_filter(char *file, int verbose, int bypass, int format,
free(labels_k[i]);
}
- fclose(yyin);
+ if (yyin != stdin)
+ fclose(yyin);
+
if (invoke_cpp)
unlink(tmp_file);