Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
service: allow set priority in range -10 to 10
  • Loading branch information
perexg committed Jun 9, 2015
1 parent 8d6cb72 commit 96ef2f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service.c
Expand Up @@ -227,7 +227,7 @@ const idclass_t service_class = {
{
.type = PT_INT,
.id = "priority",
.name = "Priority (0-10)",
.name = "Priority (-10..10)",
.off = offsetof(service_t, s_prio),
},
{
Expand Down Expand Up @@ -1572,7 +1572,7 @@ service_instance_add(service_instance_list_t *sil,
{
service_instance_t *si;

prio += MAX(0, MIN(10, s->s_prio));
prio += 10 + MAX(-10, MIN(10, s->s_prio));

/* Existing */
TAILQ_FOREACH(si, sil, si_link)
Expand Down

0 comments on commit 96ef2f3

Please sign in to comment.