Skip to content

Commit

Permalink
mxqd_control: Honor daemon prerequisites .vs. group tags
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Apr 15, 2021
1 parent 5bff524 commit acf68dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mxqd_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ static int server_is_qualified(struct mxq_server *server, struct mxq_group *grou
if (parser_context.result == 0)
return 0; // evaluated to false
}
if (*server->daemon.prerequisites != 0) {
if (*group->tags == 0) {
return 0;
}
_mx_cleanup_(keywordset_free_byref) struct keywordset *kws = keywordset_new(group->tags);
struct parser_context parser_context = {
.input = server->daemon.prerequisites,
.tags = kws,
.pos = 0,
.result = 0,
};
if (yyparse(&parser_context))
return 0; // syntax error in expression
if (parser_context.result == 0)
return 0; // evaluated to false
}
return (1);
}

Expand Down

0 comments on commit acf68dd

Please sign in to comment.