aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-28 14:53:38 +0000
committerRoy Marples <roy@marples.name>2007-09-28 14:53:38 +0000
commit7274301be24a70c094e8c91a36f3e8b6156f53ba (patch)
tree930d832f2ef37f50c99a1363958c9bfd57f05e41 /src/rc.c
parentbefddaf2418cf4a732a46aecfb79cb9cf64b3a40 (diff)
rc_service_state now returns the state as a mask, which means that we can do things with just the one call making is more efficient.
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rc.c b/src/rc.c
index 9d3206dd..3fb708f0 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -269,19 +269,19 @@ static int do_service (int argc, char **argv)
eerrorx ("%s: no service specified", applet);
if (strcmp (applet, "service_started") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_STARTED);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_STARTED);
else if (strcmp (applet, "service_stopped") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_STOPPED);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPED);
else if (strcmp (applet, "service_inactive") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_INACTIVE);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_INACTIVE);
else if (strcmp (applet, "service_starting") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_STOPPING);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPING);
else if (strcmp (applet, "service_stopping") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_STOPPING);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_STOPPING);
else if (strcmp (applet, "service_coldplugged") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_COLDPLUGGED);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_COLDPLUGGED);
else if (strcmp (applet, "service_wasinactive") == 0)
- ok = rc_service_state (argv[0], RC_SERVICE_WASINACTIVE);
+ ok = (rc_service_state (argv[0]) & RC_SERVICE_WASINACTIVE);
else if (strcmp (applet, "service_started_daemon") == 0) {
int idx = 0;
if (argc > 2)
@@ -1180,7 +1180,7 @@ int main (int argc, char **argv)
char *svc2 = NULL;
int k;
- if (rc_service_state (service, RC_SERVICE_STOPPED))
+ if (rc_service_state (service) & RC_SERVICE_STOPPED)
continue;
/* We always stop the service when in these runlevels */
@@ -1224,7 +1224,7 @@ int main (int argc, char **argv)
}
} else {
/* Allow coldplugged services not to be in the runlevels list */
- if (rc_service_state (service, RC_SERVICE_COLDPLUGGED))
+ if (rc_service_state (service) & RC_SERVICE_COLDPLUGGED)
continue;
}
@@ -1324,7 +1324,7 @@ int main (int argc, char **argv)
STRLIST_FOREACH (start_services, service, i) {
- if (rc_service_state (service, RC_SERVICE_STOPPED)) {
+ if (rc_service_state (service) & RC_SERVICE_STOPPED) {
pid_t pid;
if (! interactive)