service_stop(): Nothing to do if svc is already stopping or halted

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2018-10-05 08:54:08 +02:00
parent 6ec4dce5f9
commit 7d444e07a5
+4 -1
View File
@@ -408,7 +408,7 @@ static void service_kill(svc_t *svc)
* @svc: Service to stop
*
* Returns:
* 0 if the service was successfully stopped. Non-zero otherwise.
* 0 if the service was successfully stopped. Non-zero otherwise.
*/
static int service_stop(svc_t *svc)
{
@@ -417,6 +417,9 @@ static int service_stop(svc_t *svc)
if (!svc)
return 1;
if (svc->state <= SVC_STOPPING_STATE)
return 0;
#ifdef INETD_ENABLED
if (svc_is_inetd(svc)) {
int do_progress = runlevel != 1 && !svc_is_busy(svc);