From cc017136a7120073cb62bd0314b9bc072d465a6d Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 31 Dec 2017 20:10:22 +0000 Subject: [PATCH] Rename 'all_deps_stopped' function to 'bring_down'. The former name doesn't imply the action to be taken. --- src/service.cc | 12 ++++++------ src/service.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/service.cc b/src/service.cc index 7f03088..a29948c 100644 --- a/src/service.cc +++ b/src/service.cc @@ -423,7 +423,7 @@ rearm exec_status_pipe_watcher::fd_event(eventloop_t &loop, int fd, int flags) n // commence normal stop. Note that if pid == -1 the process already stopped(!), // that's handled below. if (sr->pid != -1 && sr->stop_check_dependents()) { - sr->all_deps_stopped(); + sr->bring_down(); } } } @@ -558,7 +558,7 @@ void service_record::execute_transition() noexcept } else if (service_state == service_state_t::STOPPING) { if (stop_check_dependents()) { - all_deps_stopped(); + bring_down(); } } } @@ -1231,7 +1231,7 @@ bool service_record::stop_dependents() noexcept } // All dependents have stopped; we can stop now, too. Only called when STOPPING. -void service_record::all_deps_stopped() noexcept +void service_record::bring_down() noexcept { waiting_for_deps = false; stopped(); @@ -1248,7 +1248,7 @@ void base_process_service::kill_pg(int signo) noexcept kill(-pgid, signo); } -void base_process_service::all_deps_stopped() noexcept +void base_process_service::bring_down() noexcept { waiting_for_deps = false; if (pid != -1) { @@ -1279,7 +1279,7 @@ void base_process_service::all_deps_stopped() noexcept } } -void process_service::all_deps_stopped() noexcept +void process_service::bring_down() noexcept { waiting_for_deps = false; if (waiting_for_execstat) { @@ -1316,7 +1316,7 @@ void process_service::all_deps_stopped() noexcept } } -void scripted_service::all_deps_stopped() noexcept +void scripted_service::bring_down() noexcept { waiting_for_deps = false; if (stop_command.length() == 0) { diff --git a/src/service.h b/src/service.h index 4ecaf67..5fa51bc 100644 --- a/src/service.h +++ b/src/service.h @@ -350,7 +350,7 @@ class service_record void emergency_stop() noexcept; // All dependents have stopped, and this service should proceed to stop. - virtual void all_deps_stopped() noexcept; + virtual void bring_down() noexcept; // Service has actually stopped (includes having all dependents // reaching STOPPED state). @@ -661,7 +661,7 @@ class base_process_service : public service_record // Perform smooth recovery process void do_smooth_recovery() noexcept; - virtual void all_deps_stopped() noexcept override; + virtual void bring_down() noexcept override; // Called when the process exits. The exit_status is the status value yielded by // the "wait" system call. @@ -716,7 +716,7 @@ class process_service : public base_process_service { virtual void handle_exit_status(int exit_status) noexcept override; virtual void exec_failed(int errcode) noexcept override; - virtual void all_deps_stopped() noexcept override; + virtual void bring_down() noexcept override; public: process_service(service_set *sset, string name, string &&command, @@ -764,7 +764,7 @@ class scripted_service : public base_process_service { virtual void handle_exit_status(int exit_status) noexcept override; virtual void exec_failed(int errcode) noexcept override; - virtual void all_deps_stopped() noexcept override; + virtual void bring_down() noexcept override; public: scripted_service(service_set *sset, string name, string &&command, -- 2.25.1