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

Diff of /trunk/src/rc.c

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

Revision 2649 Revision 2650
460} 460}
461 461
462static void wait_for_services () 462static void wait_for_services ()
463{ 463{
464 int status = 0; 464 int status = 0;
465 struct timeval tv;
466 while (wait (&status) != -1); 465 while (wait (&status) != -1);
467
468 /* Wait for a little bit to flush our ebuffer */
469 tv.tv_usec = 50000;
470 tv.tv_sec = 0;
471 select (0, NULL, NULL, NULL, &tv);
472} 466}
473 467
474static void add_pid (pid_t pid) 468static void add_pid (pid_t pid)
475{ 469{
476 pidlist_t *sp = service_pids; 470 pidlist_t *sp = service_pids;
1075 continue; 1069 continue;
1076 1070
1077 /* We always stop the service when in these runlevels */ 1071 /* We always stop the service when in these runlevels */
1078 if (going_down) { 1072 if (going_down) {
1079 pid_t pid = rc_stop_service (service); 1073 pid_t pid = rc_stop_service (service);
1080 if (pid > 0 && ! rc_is_env ("RC_PARALLEL_STARTUP", "yes")) 1074 if (pid > 0 && ! rc_is_env ("RC_PARALLEL", "yes"))
1081 rc_waitpid (pid); 1075 rc_waitpid (pid);
1082 } 1076 }
1083 1077
1084 /* If we're in the start list then don't bother stopping us */ 1078 /* If we're in the start list then don't bother stopping us */
1085 STRLIST_FOREACH (start_services, svc1, j) 1079 STRLIST_FOREACH (start_services, svc1, j)
1139 deporder = NULL; 1133 deporder = NULL;
1140 1134
1141 /* After all that we can finally stop the blighter! */ 1135 /* After all that we can finally stop the blighter! */
1142 if (! found) { 1136 if (! found) {
1143 pid_t pid = rc_stop_service (service); 1137 pid_t pid = rc_stop_service (service);
1144 if (pid > 0 && ! rc_is_env ("RC_PARALLEL_STARTUP", "yes")) 1138 if (pid > 0 && ! rc_is_env ("RC_PARALLEL", "yes"))
1145 rc_waitpid (pid); 1139 rc_waitpid (pid);
1146 } 1140 }
1147 } 1141 }
1148 rc_strlist_free (types); 1142 rc_strlist_free (types);
1149 types = NULL; 1143 types = NULL;
1225 1219
1226 /* Remember the pid if we're running in parallel */ 1220 /* Remember the pid if we're running in parallel */
1227 if ((pid = rc_start_service (service))) 1221 if ((pid = rc_start_service (service)))
1228 add_pid (pid); 1222 add_pid (pid);
1229 1223
1230 if (! rc_is_env ("RC_PARALLEL_STARTUP", "yes")) { 1224 if (! rc_is_env ("RC_PARALLEL", "yes")) {
1231 rc_waitpid (pid); 1225 rc_waitpid (pid);
1232 remove_pid (pid); 1226 remove_pid (pid);
1233 } 1227 }
1234 } 1228 }
1235 } 1229 }

Legend:
Removed from v.2649  
changed lines
  Added in v.2650

  ViewVC Help
Powered by ViewVC 1.1.20