From: Davin McCall Date: Fri, 15 Jun 2018 16:08:54 +0000 (+0100) Subject: Don't try to stop an already stopped service. X-Git-Tag: v0.3.0~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a3da07d95cf369f534213415066559b0f504c72d;p=oweals%2Fdinit.git Don't try to stop an already stopped service. It might or might not actually cause a problem, but it will at least perform some unnecessary work, so don't do it. --- diff --git a/src/service.cc b/src/service.cc index 8aeb176..2021d4f 100644 --- a/src/service.cc +++ b/src/service.cc @@ -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(); } }