aboutsummaryrefslogtreecommitdiff
path: root/cmd-queue.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-23 13:02:27 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-23 13:02:27 +0100
commit75aeb733f292639f8332df11315ca8280e5631fd (patch)
treed459b4c2381ca737009613577deafe14196eceef /cmd-queue.c
parent7ca2e2fe88cd282d3e8faea3f2000ad15972f71d (diff)
parent723010ba72e337832402f8e44981c02caa30b476 (diff)
downloadrtmux-75aeb733f292639f8332df11315ca8280e5631fd.tar.gz
rtmux-75aeb733f292639f8332df11315ca8280e5631fd.tar.bz2
rtmux-75aeb733f292639f8332df11315ca8280e5631fd.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-queue.c')
-rw-r--r--cmd-queue.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index 68bedae8..c343a212 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -175,15 +175,6 @@ cmdq_remove(struct cmdq_item *item)
free(item);
}
-/* Set command group. */
-static u_int
-cmdq_next_group(void)
-{
- static u_int group;
-
- return (++group);
-}
-
/* Remove all subsequent items that match this item's group. */
static void
cmdq_remove_group(struct cmdq_item *item)
@@ -206,7 +197,6 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
{
struct cmdq_item *item, *first = NULL, *last = NULL;
struct cmd *cmd;
- u_int group = cmdq_next_group();
struct cmdq_shared *shared;
shared = xcalloc(1, sizeof *shared);
@@ -222,13 +212,15 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item);
item->type = CMDQ_COMMAND;
- item->group = group;
+ item->group = cmd->group;
item->flags = flags;
item->shared = shared;
item->cmdlist = cmdlist;
item->cmd = cmd;
+ log_debug("%s: %s group %u", __func__, item->name, item->group);
+
shared->references++;
cmdlist->references++;