From 09d12c3716a3279fb018113964490475c6d4335e Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Sun, 13 Dec 2020 13:33:50 -0800 Subject: [PATCH] Remove SetupResult::parse_only field For parity with other setup() behavior to simply call exit() directly. --- src/main.cc | 3 --- src/zeek-setup.cc | 2 +- src/zeek-setup.h | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.cc b/src/main.cc index 68b151e600..c8b55c9f79 100644 --- a/src/main.cc +++ b/src/main.cc @@ -15,9 +15,6 @@ int main(int argc, char** argv) if ( setup_result.code ) return setup_result.code; - if ( setup_result.parse_only ) - return 0; - auto& options = setup_result.options; auto do_net_run = zeek::iosource_mgr->Size() > 0 || zeek::run_state::detail::have_pending_timers || diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index c08dfa2e23..ba8e74b02a 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -787,7 +787,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) if ( analysis_options.report_recursive ) // This option is report-and-exit. - return {0, std::move(options), true}; + exit(0); if ( dns_type != DNS_PRIME ) run_state::detail::init_run(options.interface, options.pcap_file, options.pcap_output_file, options.use_watchdog); diff --git a/src/zeek-setup.h b/src/zeek-setup.h index 60e566948d..afba00fe19 100644 --- a/src/zeek-setup.h +++ b/src/zeek-setup.h @@ -9,7 +9,6 @@ namespace zeek::detail { struct SetupResult { int code = 0; Options options; - bool parse_only = false; }; /**