Don't try to stop an already stopped service.
authorDavin McCall <davmac@davmac.org>
Fri, 15 Jun 2018 16:08:54 +0000 (17:08 +0100)
committerDavin McCall <davmac@davmac.org>
Fri, 15 Jun 2018 16:08:54 +0000 (17:08 +0100)
It might or might not actually cause a problem, but it will at least
perform some unnecessary work, so don't do it.

src/service.cc

index 8aeb176025d0362550b784577d608cedabf87bd3..2021d4fc32545308233603e5123698f2dde35bd6 100644 (file)
@@ -459,7 +459,7 @@ void service_record::stop(bool bring_down) noexcept
         release();
     }
 
-    if (bring_down) {
+    if (bring_down && service_state != service_state_t::STOPPED) {
         do_stop();
     }
 }