From d00b3a8daaa0dc72e71f7fbff6dc7d2c5bf5fa3d Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 15 Jun 2020 15:05:18 -0700 Subject: [PATCH] Move ParentProcessCheckTimer to detail namespace --- src/main.cc | 2 +- src/supervisor/Supervisor.cc | 5 +++-- src/supervisor/Supervisor.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index 3cd648a0aa..d0760d9df9 100644 --- a/src/main.cc +++ b/src/main.cc @@ -38,7 +38,7 @@ int main(int argc, char** argv) #endif if ( zeek::Supervisor::ThisNode() ) - timer_mgr->Add(new zeek::ParentProcessCheckTimer(1, 1)); + timer_mgr->Add(new zeek::detail::ParentProcessCheckTimer(1, 1)); double time_net_start = current_time(true);; diff --git a/src/supervisor/Supervisor.cc b/src/supervisor/Supervisor.cc index 01b086608b..f649e780b9 100644 --- a/src/supervisor/Supervisor.cc +++ b/src/supervisor/Supervisor.cc @@ -140,12 +140,13 @@ static std::string make_create_message(const Supervisor::NodeConfig& node) return fmt("create %s %s", node.name.data(), json_str.data()); } -ParentProcessCheckTimer::ParentProcessCheckTimer(double t, double arg_interval) +zeek::detail::ParentProcessCheckTimer::ParentProcessCheckTimer(double t, + double arg_interval) : Timer(t, TIMER_PPID_CHECK), interval(arg_interval) { } -void ParentProcessCheckTimer::Dispatch(double t, bool is_expire) +void zeek::detail::ParentProcessCheckTimer::Dispatch(double t, bool is_expire) { // Note: only simple + portable way of detecting loss of parent // process seems to be polling for change in PPID. There's platform diff --git a/src/supervisor/Supervisor.h b/src/supervisor/Supervisor.h index 114385366b..e514c4eb00 100644 --- a/src/supervisor/Supervisor.h +++ b/src/supervisor/Supervisor.h @@ -389,6 +389,7 @@ private: std::string msg_buffer; }; +namespace detail { /** * A timer used by supervised processes to periodically check whether their * parent (supervisor) process has died. If it has died, the supervised @@ -410,6 +411,7 @@ protected: double interval; }; +} extern Supervisor* supervisor_mgr;