Fix restart after unexpected termination.
authorDavin McCall <davmac@davmac.org>
Sat, 25 May 2019 14:56:12 +0000 (00:56 +1000)
committerDavin McCall <davmac@davmac.org>
Sat, 25 May 2019 15:01:56 +0000 (01:01 +1000)
src/service.cc
src/tests/test-includes/dinit.h

index 40ab90b539be194c8b49efdae97127d9d5ee638a..504a9b6de0836710449785effbac4a3f04b97452 100644 (file)
@@ -458,7 +458,7 @@ void service_record::forced_stop() noexcept
         force_stop = true;
         if (! pinned_started) {
             prop_stop = true;
-            services->add_transition_queue(this);
+            services->add_prop_queue(this);
         }
     }
 }
index d97493d8f13a5cdf2a04438d4231dd54cec296bb..3b99881a2e0bc184eaccdb182df65078c18fc0d4 100644 (file)
@@ -31,7 +31,8 @@ class eventloop_t
     void advance_time(time_val amount)
     {
         current_time += amount;
-        for (timer * t : active_timers) {
+        auto active_copy = active_timers;
+        for (timer * t : active_copy) {
             if (t->expiry_time >= current_time) {
                 t->stop_timer(*this);
                 rearm r = t->expired(*this, 1);