summaryrefslogtreecommitdiff
path: root/src/rc/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-17 14:31:44 +0000
committerRoy Marples <roy@marples.name>2008-03-17 14:31:44 +0000
commitb2f7606b2366bd4c7196f3ce786375353e942e80 (patch)
treef7c377485f3a3a755b1d6a74ecb27bc8811da6f8 /src/rc/rc.c
parent4c1466642351ddb01cc7353601153a79326f18f7 (diff)
downloadopenrc-b2f7606b2366bd4c7196f3ce786375353e942e80.tar.gz
openrc-b2f7606b2366bd4c7196f3ce786375353e942e80.tar.bz2
openrc-b2f7606b2366bd4c7196f3ce786375353e942e80.tar.xz
We should check for NULL here.
Diffstat (limited to 'src/rc/rc.c')
-rw-r--r--src/rc/rc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 04b814e..30bedcb 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);