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

Diff of /trunk/src/rc.c

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

Revision 2950 Revision 2953
267 267
268 if (argc < 1 || ! argv[0] || strlen (argv[0]) == 0) 268 if (argc < 1 || ! argv[0] || strlen (argv[0]) == 0)
269 eerrorx ("%s: no service specified", applet); 269 eerrorx ("%s: no service specified", applet);
270 270
271 if (strcmp (applet, "service_started") == 0) 271 if (strcmp (applet, "service_started") == 0)
272 ok = rc_service_state (argv[0], RC_SERVICE_STARTED); 272 ok = (rc_service_state (argv[0]) & RC_SERVICE_STARTED);
273 else if (strcmp (applet, "service_stopped") == 0) 273 else if (strcmp (applet, "service_stopped") == 0)
274 ok = rc_service_state (argv[0], RC_SERVICE_STOPPED); 274 ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPED);
275 else if (strcmp (applet, "service_inactive") == 0) 275 else if (strcmp (applet, "service_inactive") == 0)
276 ok = rc_service_state (argv[0], RC_SERVICE_INACTIVE); 276 ok = (rc_service_state (argv[0]) & RC_SERVICE_INACTIVE);
277 else if (strcmp (applet, "service_starting") == 0) 277 else if (strcmp (applet, "service_starting") == 0)
278 ok = rc_service_state (argv[0], RC_SERVICE_STOPPING); 278 ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPING);
279 else if (strcmp (applet, "service_stopping") == 0) 279 else if (strcmp (applet, "service_stopping") == 0)
280 ok = rc_service_state (argv[0], RC_SERVICE_STOPPING); 280 ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPING);
281 else if (strcmp (applet, "service_coldplugged") == 0) 281 else if (strcmp (applet, "service_coldplugged") == 0)
282 ok = rc_service_state (argv[0], RC_SERVICE_COLDPLUGGED); 282 ok = (rc_service_state (argv[0]) & RC_SERVICE_COLDPLUGGED);
283 else if (strcmp (applet, "service_wasinactive") == 0) 283 else if (strcmp (applet, "service_wasinactive") == 0)
284 ok = rc_service_state (argv[0], RC_SERVICE_WASINACTIVE); 284 ok = (rc_service_state (argv[0]) & RC_SERVICE_WASINACTIVE);
285 else if (strcmp (applet, "service_started_daemon") == 0) { 285 else if (strcmp (applet, "service_started_daemon") == 0) {
286 int idx = 0; 286 int idx = 0;
287 if (argc > 2) 287 if (argc > 2)
288 sscanf (argv[2], "%d", &idx); 288 sscanf (argv[2], "%d", &idx);
289 exit (rc_service_started_daemon (argv[0], argv[1], idx) 289 exit (rc_service_started_daemon (argv[0], argv[1], idx)
1178 char **stopdeps = NULL; 1178 char **stopdeps = NULL;
1179 char *svc1 = NULL; 1179 char *svc1 = NULL;
1180 char *svc2 = NULL; 1180 char *svc2 = NULL;
1181 int k; 1181 int k;
1182 1182
1183 if (rc_service_state (service, RC_SERVICE_STOPPED)) 1183 if (rc_service_state (service) & RC_SERVICE_STOPPED)
1184 continue; 1184 continue;
1185 1185
1186 /* We always stop the service when in these runlevels */ 1186 /* We always stop the service when in these runlevels */
1187 if (going_down) { 1187 if (going_down) {
1188 pid_t pid = rc_stop_service (service); 1188 pid_t pid = rc_stop_service (service);
1222 if (!found) 1222 if (!found)
1223 continue; 1223 continue;
1224 } 1224 }
1225 } else { 1225 } else {
1226 /* Allow coldplugged services not to be in the runlevels list */ 1226 /* Allow coldplugged services not to be in the runlevels list */
1227 if (rc_service_state (service, RC_SERVICE_COLDPLUGGED)) 1227 if (rc_service_state (service) & RC_SERVICE_COLDPLUGGED)
1228 continue; 1228 continue;
1229 } 1229 }
1230 1230
1231 /* We got this far! Or last check is to see if any any service that 1231 /* We got this far! Or last check is to see if any any service that
1232 going to be started depends on us */ 1232 going to be started depends on us */
1322 } 1322 }
1323#endif 1323#endif
1324 1324
1325 1325
1326 STRLIST_FOREACH (start_services, service, i) { 1326 STRLIST_FOREACH (start_services, service, i) {
1327 if (rc_service_state (service, RC_SERVICE_STOPPED)) { 1327 if (rc_service_state (service) & RC_SERVICE_STOPPED) {
1328 pid_t pid; 1328 pid_t pid;
1329 1329
1330 if (! interactive) 1330 if (! interactive)
1331 interactive = want_interactive (); 1331 interactive = want_interactive ();
1332 1332

Legend:
Removed from v.2950  
changed lines
  Added in v.2953

  ViewVC Help
Powered by ViewVC 1.1.20