diff options
author | Roy Marples <roy@marples.name> | 2007-09-25 17:19:02 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-09-25 17:19:02 +0000 |
commit | 1a6451654fe365c1981b18f35cb6e453166d1b32 (patch) | |
tree | 35f036a9e6eba2322267b23688495a9f2390ada8 /src/librc-depend.c | |
parent | b24e87794849f38611f0b9644c1e30222d8369a6 (diff) |
We no longer use bool in our public headers, using int instead.
Diffstat (limited to 'src/librc-depend.c')
-rw-r--r-- | src/librc-depend.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/librc-depend.c b/src/librc-depend.c index 4df64635..cc6fcbdd 100644 --- a/src/librc-depend.c +++ b/src/librc-depend.c @@ -185,10 +185,10 @@ librc_hidden_def(rc_get_deptype) static bool valid_service (const char *runlevel, const char *service) { return ((strcmp (runlevel, bootlevel) != 0 && - rc_service_in_runlevel (service, bootlevel)) || - rc_service_in_runlevel (service, runlevel) || - rc_service_state (service, rc_service_coldplugged) || - rc_service_state (service, rc_service_started)); + rc_service_in_runlevel (service, bootlevel) == 0) || + rc_service_in_runlevel (service, runlevel) == 0 || + rc_service_state (service, rc_service_coldplugged) == 0 || + rc_service_state (service, rc_service_started) == 0); } static bool get_provided1 (const char *runlevel, struct lhead *providers, @@ -204,25 +204,25 @@ static bool get_provided1 (const char *runlevel, struct lhead *providers, { bool ok = true; if (level) - ok = rc_service_in_runlevel (service, level); + ok = (rc_service_in_runlevel (service, level) == 0); else if (coldplugged) - ok = (rc_service_state (service, rc_service_coldplugged) && - ! rc_service_in_runlevel (service, runlevel) && - ! rc_service_in_runlevel (service, bootlevel)); + ok = (rc_service_state (service, rc_service_coldplugged) == 0 && + rc_service_in_runlevel (service, runlevel) != 0 && + rc_service_in_runlevel (service, bootlevel) != 0); if (! ok) continue; switch (state) { case rc_service_started: - ok = rc_service_state (service, state); + ok = (rc_service_state (service, state) == 0); break; case rc_service_inactive: case rc_service_starting: case rc_service_stopping: - ok = (rc_service_state (service, rc_service_starting) || - rc_service_state (service, rc_service_stopping) || - rc_service_state (service, rc_service_inactive)); + ok = (rc_service_state (service, rc_service_starting) == 0 || + rc_service_state (service, rc_service_stopping) == 0 || + rc_service_state (service, rc_service_inactive) == 0); break; default: break; @@ -257,7 +257,7 @@ static char **get_provided (rc_depinfo_t *deptree, rc_depinfo_t *depinfo, if (! deptree || ! depinfo) return (NULL); - if (rc_service_exists (depinfo->service)) + if (rc_service_exists (depinfo->service) == -1) return (NULL); dt = rc_get_deptype (depinfo, "providedby"); @@ -281,8 +281,8 @@ static char **get_provided (rc_depinfo_t *deptree, rc_depinfo_t *depinfo, if (options & RC_DEP_STRICT) { STRLIST_FOREACH (dt->services, service, i) - if (rc_service_in_runlevel (service, runlevel) || - rc_service_in_runlevel (service, bootlevel)) + if (rc_service_in_runlevel (service, runlevel) == 0 || + rc_service_in_runlevel (service, bootlevel) == 0) rc_strlist_add (&providers.list, service); if (providers.list) @@ -556,7 +556,7 @@ static bool is_newer_than (const char *file, const char *target) if (mtime < buf.st_mtime) return (false); - if (rc_is_dir (target)) + if (rc_is_dir (target) == 0) { char **targets = rc_ls_dir (target, 0); char *t; @@ -641,7 +641,7 @@ int rc_update_deptree (bool force) /* Create base directories if needed */ for (i = 0; depdirs[i]; i++) - if (! rc_is_dir (depdirs[i])) + if (rc_is_dir (depdirs[i]) != 0) if (mkdir (depdirs[i], 0755) != 0) eerrorx ("mkdir `%s': %s", depdirs[i], strerror (errno)); @@ -655,7 +655,7 @@ int rc_update_deptree (bool force) /* Some init scripts dependencies change depending on config files * outside of baselayout, like syslog-ng, so we check those too. */ - if (! rc_exists (RC_DEPCONFIG)) + if (rc_exists (RC_DEPCONFIG) != 0) return 0; config = rc_get_list (RC_DEPCONFIG); |