summaryrefslogtreecommitdiff
path: root/trafgen_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 /trafgen_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 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 21c3454..a05b7e8 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -635,7 +635,8 @@ void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp
ret = 0;
err:
- fclose(yyin);
+ if (yyin != stdin)
+ fclose(yyin);
if (invoke_cpp)
unlink(tmp_file);