diff options
| author | Stefano Brivio <sbrivio@redhat.com> | 2025-08-13 18:45:05 +0200 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-08-19 16:29:52 +0200 |
| commit | b4fc6cd31a8729b92a305008e443b56310fd30d4 (patch) | |
| tree | a099fcab216f8489758791041a59de541d4673f7 /test/lib | |
| parent | 309eefd6af5ba20f760b92b6131a9ea7f2e161d4 (diff) | |
| download | passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar.gz passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar.bz2 passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar.lz passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar.xz passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.tar.zst passt-b4fc6cd31a8729b92a305008e443b56310fd30d4.zip | |
treewide: Flush pcap and log files, if used, before exiting
I didn't imagine that occasionally truncated pcap and log files, as a
result of commit d0006fa784a7 ("treewide: use _exit() over exit()"),
would be such a big deal, until I tried to debug TCP issues with this
beauty:
while true; do ./pasta --trace -l /tmp/pasta.log -p /tmp/pasta.pcap --config-net -t 5555 -- socat TCP-LISTEN:5555 OPEN:/tmp/large.rcv,trunc & (sleep 0.3; socat -T2 OPEN:large.bin TCP:88.198.0.164:5555; ); wait; diff large.bin /tmp/large.rcv || break; done
...flush files and pcap if we're using them. Ignore fsync() errors for
the log file as we obviously can't reliably log them.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib')
0 files changed, 0 insertions, 0 deletions
