From 28d7fb9430401d1d2947cd75672f03562582bb08 Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Sat, 27 Sep 2008 16:56:03 +0000
Subject: When stopping services, check the newlevel if given otherwise the
 current runlevel. Fixes #100.

---
 src/rc/rc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/rc.c b/src/rc/rc.c
index 62544cad..35dc53f2 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -805,7 +805,7 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle
 			tmplist = rc_stringlist_new();
 			rc_stringlist_add(tmplist, service->value);
 			deporder = rc_deptree_depends(deptree, types_n, tmplist,
-						      runlevel,
+						      newlevel ? newlevel : runlevel,
 						      RC_DEP_STRICT | RC_DEP_TRACE);
 			rc_stringlist_free(tmplist);
 			svc2 = NULL;
-- 
cgit v1.2.3