diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-10-18 12:01:10 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-10-18 12:01:10 +0100 |
commit | 8576ecaf322e5828c86e9621015d68e755c0323b (patch) | |
tree | fbf6d39f1c743c1b272dc35c2d3086a8b99552f5 /cmd-queue.c | |
parent | b3ab39c4d94a0d5785de069ba428a8ad53a0af20 (diff) | |
parent | 2e5c49a1fd8c534d546899f7c133a0adf212a7d1 (diff) | |
download | rtmux-8576ecaf322e5828c86e9621015d68e755c0323b.tar.gz rtmux-8576ecaf322e5828c86e9621015d68e755c0323b.tar.bz2 rtmux-8576ecaf322e5828c86e9621015d68e755c0323b.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index 5056fffc..24fd0c56 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -112,6 +112,8 @@ cmdq_remove(struct cmdq_item *item) cmd_list_free(item->cmdlist); TAILQ_REMOVE(item->queue, item, entry); + + free((void *)item->name); free(item); } @@ -147,10 +149,15 @@ 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(); + char *tmp; TAILQ_FOREACH(cmd, &cmdlist->list, qentry) { + xasprintf(&tmp, "command[%s]", cmd->entry->name); + item = xcalloc(1, sizeof *item); + item->name = tmp; item->type = CMDQ_COMMAND; + item->group = group; item->flags = flags; @@ -220,12 +227,17 @@ out: /* Get a callback for the command queue. */ struct cmdq_item * -cmdq_get_callback(cmdq_cb cb, void *data) +cmdq_get_callback1(const char *name, cmdq_cb cb, void *data) { struct cmdq_item *item; + char *tmp; + + xasprintf(&tmp, "callback[%s]", name); item = xcalloc(1, sizeof *item); + item->name = tmp; item->type = CMDQ_CALLBACK; + item->group = 0; item->flags = 0; @@ -289,8 +301,8 @@ cmdq_next(struct client *c) item = TAILQ_FIRST(queue); if (item == NULL) break; - log_debug("%s %s: type %d, flags %x", __func__, name, - item->type, item->flags); + log_debug("%s %s: %s (%d), flags %x", __func__, name, + item->name, item->type, item->flags); /* * Any item with the waiting flag set waits until an external |