summaryrefslogtreecommitdiff
path: root/pcap_sg.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-08-09 12:28:15 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-08-09 13:56:59 +0200
commit4e47fd021a6945aa626eaef4446c5b547d8c2a85 (patch)
treebd77315e8eef043cd8e53699fa7125390418f9d8 /pcap_sg.c
parent48178cd649b48196e16e0481ca44dea206fe04d4 (diff)
trafgen: parser: Check read access to file before invoking cpp
If a non-accessible (or non-existing) file is passed to trafgen and the -p/--cpp option is used, the preprocessor will fail but trafgen will continue running and producing follow-up errors messages: cpp: error: foo.conf: No such file or directory cpp: warning: ā€˜-x cā€™ after last input file has no effect cpp: fatal error: no input files compilation terminated. 0 packets to schedule Enabled kernel qdisc bypass 0 bytes in total Running! Hang up with ^C! Enabled kernel qdisc bypass TX,V2: 0.50 MiB, 256 Frames, each 2048 Byte allocated TX,V2: 0.50 MiB, 256 Frames, each 2048 Byte allocated 0 packets outgoing 0 bytes outgoing 0 sec, 0 usec on CPU0 (0 packets) 0 sec, 0 usec on CPU1 (0 packets) To avoid this, check that the file is readable before passing it to the preprocessor and error out if is not readable. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'pcap_sg.c')
0 files changed, 0 insertions, 0 deletions