From b2f7606b2366bd4c7196f3ce786375353e942e80 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 17 Mar 2008 14:31:44 +0000 Subject: We should check for NULL here. --- src/rc/rc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/rc/rc.c') diff --git a/src/rc/rc.c b/src/rc/rc.c index 04b814e6..30bedcbf 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -778,7 +778,7 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle continue; /* We always stop the service when in these runlevels */ - if (going_down) { + if (going_down || ! start_services) { pid = rc_service_stop(service->value); if (pid > 0 && ! parallel) rc_waitpid(pid); @@ -1097,18 +1097,20 @@ int main(int argc, char **argv) } else stop_services = tmplist; } - rc_stringlist_sort(&stop_services); - + if (stop_services) + rc_stringlist_sort(&stop_services); types_nua = rc_stringlist_new(); rc_stringlist_add(types_nua, "ineed"); rc_stringlist_add(types_nua, "iuse"); rc_stringlist_add(types_nua, "iafter"); - tmplist = rc_deptree_depends(deptree, types_nua, stop_services, - runlevel, depoptions | RC_DEP_STOP); - rc_stringlist_free(stop_services); - stop_services = tmplist; + if (stop_services) { + tmplist = rc_deptree_depends(deptree, types_nua, stop_services, + runlevel, depoptions | RC_DEP_STOP); + rc_stringlist_free(stop_services); + stop_services = tmplist; + } /* Load our list of coldplugged services */ coldplugged_services = rc_services_in_state(RC_SERVICE_COLDPLUGGED); -- cgit v1.2.3