Remove early opening of output files if running in an offline mode, as
we don't yet know the timestamp to use.
Prevents the first pcap files being opened with a timestamp of 0,
bringing us back to the same behvaviour of pcap logging in 6.0.
Issue: 5374
#endif /* INIT_RING_BUFFER */
}
- if (pl->mode == LOGMODE_MULTI) {
- PcapLogOpenFileCtx(td->pcap_log);
- } else {
- if (pl->filename == NULL) {
- PcapLogOpenFileCtx(pl);
+ /* Don't early initialize output files if in a PCAP file mode. */
+ if (IsRunModeOffline(RunmodeGetCurrent())) {
+ if (pl->mode == LOGMODE_MULTI) {
+ PcapLogOpenFileCtx(td->pcap_log);
+ } else {
+ if (pl->filename == NULL) {
+ PcapLogOpenFileCtx(pl);
+ }
}
}