From: Davin McCall Date: Mon, 19 Jun 2017 08:57:02 +0000 (+0100) Subject: Remove unneeded function parameter. X-Git-Tag: v0.06~51 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=55bb0a7e2aca7d0b0bc74f306091cd118b77695c;p=oweals%2Fdinit.git Remove unneeded function parameter. Also rename: processQueues to process_queues. --- diff --git a/src/control.cc b/src/control.cc index 2ce4ffe..b2152c4 100644 --- a/src/control.cc +++ b/src/control.cc @@ -165,7 +165,7 @@ bool control_conn_t::processStartStop(int pktType) // start service, mark as required if (do_pin) service->pinStart(); service->start(); - services->processQueues(true); + services->process_queues(); already_there = service->getState() == service_state_t::STARTED; break; case DINIT_CP_STOPSERVICE: @@ -173,21 +173,21 @@ bool control_conn_t::processStartStop(int pktType) if (do_pin) service->pinStop(); service->stop(true); service->forceStop(); - services->processQueues(false); + services->process_queues(); already_there = service->getState() == service_state_t::STOPPED; break; case DINIT_CP_WAKESERVICE: // re-start a stopped service (do not mark as required) if (do_pin) service->pinStart(); service->start(false); - services->processQueues(true); + services->process_queues(); already_there = service->getState() == service_state_t::STARTED; break; case DINIT_CP_RELEASESERVICE: // remove required mark, stop if not required by dependents if (do_pin) service->pinStop(); service->stop(false); - services->processQueues(false); + services->process_queues(); already_there = service->getState() == service_state_t::STOPPED; break; } @@ -231,7 +231,7 @@ bool control_conn_t::processUnpinService() } else { service->unpin(); - services->processQueues(true); + services->process_queues(); char ack_buf[] = { (char) DINIT_RP_ACK }; if (! queuePacket(ack_buf, 1)) return false; } diff --git a/src/service.cc b/src/service.cc index 2d83960..b9b55ce 100644 --- a/src/service.cc +++ b/src/service.cc @@ -52,7 +52,7 @@ void service_set::stopService(const std::string & name) noexcept service_record *record = find_service(name); if (record != nullptr) { record->stop(); - processQueues(false); + process_queues(); } } @@ -187,14 +187,14 @@ void process_service::handle_exit_status(int exit_status) noexcept // service process. if (! restart_ps_process()) { emergency_stop(); - services->processQueues(false); + services->process_queues(); } return; } else { emergency_stop(); } - services->processQueues(false); + services->process_queues(); } void bgproc_service::handle_exit_status(int exit_status) noexcept @@ -230,7 +230,7 @@ void bgproc_service::handle_exit_status(int exit_status) noexcept if (need_stop) { // Failed startup: no auto-restart. emergency_stop(); - services->processQueues(false); + services->process_queues(); } return; @@ -263,7 +263,7 @@ void bgproc_service::handle_exit_status(int exit_status) noexcept doing_recovery = true; if (! restart_ps_process()) { emergency_stop(); - services->processQueues(); + services->process_queues(); } return; } @@ -277,7 +277,7 @@ void bgproc_service::handle_exit_status(int exit_status) noexcept stopDependents(); stopped(); } - services->processQueues(false); + services->process_queues(); } void scripted_service::handle_exit_status(int exit_status) noexcept @@ -301,7 +301,7 @@ void scripted_service::handle_exit_status(int exit_status) noexcept // can be stopped: stopped(); } - services->processQueues(false); + services->process_queues(); } else { // STARTING if (exit_status == 0) { @@ -317,7 +317,7 @@ void scripted_service::handle_exit_status(int exit_status) noexcept } failed_to_start(); } - services->processQueues(true); + services->process_queues(); } } @@ -364,7 +364,7 @@ rearm exec_status_pipe_watcher::fd_event(eventloop_t &loop, int fd, int flags) n } } - sr->services->processQueues(true); + sr->services->process_queues(); return rearm::REMOVED; } @@ -1179,14 +1179,14 @@ void service_record::unpin() noexcept pinned_started = false; if (desired_state == service_state_t::STOPPED) { do_stop(); - services->processQueues(false); + services->process_queues(); } } if (pinned_stopped) { pinned_stopped = false; if (desired_state == service_state_t::STARTED) { do_start(); - services->processQueues(true); + services->process_queues(); } } } @@ -1252,7 +1252,7 @@ void base_process_service::do_restart() noexcept desired_state = service_state_t::STOPPED; forceStop(); } - services->processQueues(); + services->process_queues(); } } diff --git a/src/service.h b/src/service.h index e3f40b1..6e1d111 100644 --- a/src/service.h +++ b/src/service.h @@ -788,14 +788,14 @@ class service_set void start_service(service_record *svc) { svc->start(); - processQueues(); + process_queues(); } // Stop the specified service. Its active mark will be cleared. void stop_service(service_record *svc) { svc->stop(true); - processQueues(); + process_queues(); } // Locate an existing service record. @@ -875,8 +875,7 @@ class service_set } // Process state propagation and start/stop queues, until they are empty. - // TODO remove the pointless parameter - void processQueues(bool ignoredparam = false) noexcept + void process_queues() noexcept { while (! stop_queue.is_empty() || ! prop_queue.is_empty()) { while (! prop_queue.is_empty()) { @@ -942,7 +941,7 @@ class service_set (*i)->stop(false); (*i)->unpin(); } - processQueues(false); + process_queues(); } void set_auto_restart(bool restart) noexcept