summaryrefslogtreecommitdiffstats
path: root/cmd-queue.c
diff options
context:
space:
mode:
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++;