/[baselayout]/trunk/src/rc.c
Gentoo

Diff of /trunk/src/rc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2885 Revision 2886
813 signal (SIGUSR1, handle_signal); 813 signal (SIGUSR1, handle_signal);
814 814
815 /* Ensure our environment is pure 815 /* Ensure our environment is pure
816 Also, add our configuration to it */ 816 Also, add our configuration to it */
817 env = rc_filter_env (); 817 env = rc_filter_env ();
818 env = rc_strlist_join (env, rc_make_env ()); 818 rc_strlist_join (&env, rc_make_env ());
819 819
820 if (env) { 820 if (env) {
821 char *p; 821 char *p;
822 822
823#ifdef __linux__ 823#ifdef __linux__
1087#endif 1087#endif
1088 1088
1089 /* Build a list of all services to stop and then work out the 1089 /* Build a list of all services to stop and then work out the
1090 correct order for stopping them */ 1090 correct order for stopping them */
1091 stop_services = rc_ls_dir (RC_SVCDIR_STARTING, RC_LS_INITD); 1091 stop_services = rc_ls_dir (RC_SVCDIR_STARTING, RC_LS_INITD);
1092 stop_services = rc_strlist_join (stop_services, 1092 rc_strlist_join (&stop_services,
1093 rc_ls_dir (RC_SVCDIR_INACTIVE, RC_LS_INITD)); 1093 rc_ls_dir (RC_SVCDIR_INACTIVE, RC_LS_INITD));
1094 stop_services = rc_strlist_join (stop_services, 1094 rc_strlist_join (&stop_services,
1095 rc_ls_dir (RC_SVCDIR_STARTED, RC_LS_INITD)); 1095 rc_ls_dir (RC_SVCDIR_STARTED, RC_LS_INITD));
1096 1096
1097 types = NULL; 1097 types = NULL;
1098 rc_strlist_add (&types, "ineed"); 1098 rc_strlist_add (&types, "ineed");
1099 rc_strlist_add (&types, "iuse"); 1099 rc_strlist_add (&types, "iuse");
1100 rc_strlist_add (&types, "iafter"); 1100 rc_strlist_add (&types, "iafter");
1121 } 1121 }
1122 printf ("\n"); 1122 printf ("\n");
1123 } 1123 }
1124 tmp = rc_strcatpaths (RC_RUNLEVELDIR, newlevel ? newlevel : runlevel, 1124 tmp = rc_strcatpaths (RC_RUNLEVELDIR, newlevel ? newlevel : runlevel,
1125 (char *) NULL); 1125 (char *) NULL);
1126 start_services = rc_strlist_join (start_services, 1126 rc_strlist_join (&start_services, rc_ls_dir (tmp, RC_LS_INITD));
1127 rc_ls_dir (tmp, RC_LS_INITD));
1128 CHAR_FREE (tmp); 1127 CHAR_FREE (tmp);
1129 } else { 1128 } else {
1130 /* Store our list of coldplugged services */ 1129 /* Store our list of coldplugged services */
1131 coldplugged_services = rc_strlist_join (coldplugged_services, 1130 rc_strlist_join (&coldplugged_services,
1132 rc_ls_dir (RC_SVCDIR_COLDPLUGGED, RC_LS_INITD)); 1131 rc_ls_dir (RC_SVCDIR_COLDPLUGGED, RC_LS_INITD));
1133 if (strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_SINGLE) != 0 && 1132 if (strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_SINGLE) != 0 &&
1134 strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 && 1133 strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 &&
1135 strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_REBOOT) != 0) 1134 strcmp (newlevel ? newlevel : runlevel, RC_LEVEL_REBOOT) != 0)
1136 { 1135 {
1137 /* We need to include the boot runlevel services if we're not in it */ 1136 /* We need to include the boot runlevel services if we're not in it */
1137 rc_strlist_join (&start_services,
1138 char **services = rc_services_in_runlevel (bootlevel); 1138 rc_services_in_runlevel (bootlevel));
1139 1139 rc_strlist_join (&start_services,
1140 start_services = rc_strlist_join (start_services, services); 1140 rc_services_in_runlevel (newlevel ?
1141 services = rc_services_in_runlevel (newlevel ? newlevel : runlevel); 1141 newlevel : runlevel));
1142 start_services = rc_strlist_join (start_services, services);
1143 services = NULL;
1144
1145 STRLIST_FOREACH (coldplugged_services, service, i) 1142 STRLIST_FOREACH (coldplugged_services, service, i)
1146 rc_strlist_add (&start_services, service); 1143 rc_strlist_add (&start_services, service);
1147 1144
1148 } 1145 }
1149 } 1146 }

Legend:
Removed from v.2885  
changed lines
  Added in v.2886

  ViewVC Help
Powered by ViewVC 1.1.20