]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
pcap: simplify opening of output file
authorJeremy Sowden <jeremy@azazel.net>
Thu, 16 Mar 2023 11:07:53 +0000 (11:07 +0000)
committerFlorian Westphal <fw@strlen.de>
Thu, 16 Mar 2023 22:24:55 +0000 (23:24 +0100)
commit3994535c1d54028ae0a3268e001c9598c7c335ed
treedacc10a8799cc842ed65966717b6d68d1f3e94b8
parent9fa2184c303a237917b76da74f7271dca70d0d90
pcap: simplify opening of output file

Instead of statting the file, and choosing the mode with which to open
it and whether to write the PCAP header based on the result, always open
it with mode "a" and _then_ stat it.  This simplifies the flow-control
and avoids a race between statting and opening.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
output/pcap/ulogd_output_PCAP.c