Remove unneeded function parameter.
authorDavin McCall <davmac@davmac.org>
Mon, 19 Jun 2017 08:57:02 +0000 (09:57 +0100)
committerDavin McCall <davmac@davmac.org>
Mon, 19 Jun 2017 08:57:02 +0000 (09:57 +0100)
Also rename: processQueues to process_queues.

src/control.cc
src/service.cc
src/service.h

index 2ce4ffee794db3034f3fd58c26edca4e8fa5f3fe..b2152c47a06a0355fb13593870fbb41ce30563c2 100644 (file)
@@ -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;
     }
index 2d83960289ce3e07fa8b6baf1a306f6b243a0ea5..b9b55ce3badc6ce978264714bedb0e59937ed857 100644 (file)
@@ -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();
     }
 }
 
index e3f40b113d8a8e6d797893a5437e05327d0df860..6e1d111751c60de88e50e86e5a6dd7e3528cda1f 100644 (file)
@@ -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