Use the new rc_stringlist_find function.
This commit is contained in:
parent
312d6f3e57
commit
354fb96ee9
@ -506,19 +506,12 @@ static bool svc_wait(const char *svc)
|
|||||||
bool retval = false;
|
bool retval = false;
|
||||||
bool forever = false;
|
bool forever = false;
|
||||||
RC_STRINGLIST *keywords;
|
RC_STRINGLIST *keywords;
|
||||||
RC_STRING *s;
|
|
||||||
|
|
||||||
/* Some services don't have a timeout, like fsck */
|
/* Some services don't have a timeout, like fsck */
|
||||||
keywords = rc_deptree_depend(deptree, svc, "keyword");
|
keywords = rc_deptree_depend(deptree, svc, "keyword");
|
||||||
if (keywords) {
|
if (rc_stringlist_find(keywords, "notimeout"))
|
||||||
TAILQ_FOREACH(s, keywords, entries) {
|
|
||||||
if (strcmp (s->value, "notimeout") == 0) {
|
|
||||||
forever = true;
|
forever = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rc_stringlist_free(keywords);
|
rc_stringlist_free(keywords);
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(fifo, sizeof(fifo), RC_SVCDIR "/exclusive/%s", basename_c(svc));
|
snprintf(fifo, sizeof(fifo), RC_SVCDIR "/exclusive/%s", basename_c(svc));
|
||||||
ts.tv_sec = 0;
|
ts.tv_sec = 0;
|
||||||
@ -651,19 +644,6 @@ static void setup_types(void)
|
|||||||
rc_stringlist_add(types_mua, "beforeme");
|
rc_stringlist_add(types_mua, "beforeme");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool in_list(RC_STRINGLIST *list, char *string)
|
|
||||||
{
|
|
||||||
RC_STRING *s;
|
|
||||||
|
|
||||||
if (! list)
|
|
||||||
return false;
|
|
||||||
TAILQ_FOREACH(s, list, entries)
|
|
||||||
if (strcmp(s->value, string) == 0)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void svc_start(bool deps)
|
static void svc_start(bool deps)
|
||||||
{
|
{
|
||||||
bool started;
|
bool started;
|
||||||
@ -774,8 +754,8 @@ static void svc_start(bool deps)
|
|||||||
if (state & RC_SERVICE_STARTING &&
|
if (state & RC_SERVICE_STARTING &&
|
||||||
state & RC_SERVICE_WASINACTIVE)
|
state & RC_SERVICE_WASINACTIVE)
|
||||||
{
|
{
|
||||||
if (!in_list(need_services, svc->value) &&
|
if (!rc_stringlist_find(need_services, svc->value) &&
|
||||||
!in_list(use_services, svc->value))
|
!rc_stringlist_find(use_services, svc->value))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,7 +765,7 @@ static void svc_start(bool deps)
|
|||||||
state = rc_service_state(svc->value);
|
state = rc_service_state(svc->value);
|
||||||
if (state & RC_SERVICE_STARTED)
|
if (state & RC_SERVICE_STARTED)
|
||||||
continue;
|
continue;
|
||||||
if (in_list(need_services, svc->value)) {
|
if (rc_stringlist_find(need_services, svc->value)) {
|
||||||
if (state & RC_SERVICE_INACTIVE ||
|
if (state & RC_SERVICE_INACTIVE ||
|
||||||
state & RC_SERVICE_WASINACTIVE)
|
state & RC_SERVICE_WASINACTIVE)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user