diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-08-21 20:01:22 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-08-21 20:01:22 +0100 |
commit | 921991c98d6fd596c958b07b5f5aba7c434e8f9f (patch) | |
tree | 42f00694a9edf1793209be4842987379d0171542 /cmd-queue.c | |
parent | 4d3367e9657002c4b68867c8d58e2f5b7ae90612 (diff) | |
parent | 63b6eec27889e4c38b4a051a1bb3463f153cc2c8 (diff) | |
download | rtmux-921991c98d6fd596c958b07b5f5aba7c434e8f9f.tar.gz rtmux-921991c98d6fd596c958b07b5f5aba7c434e8f9f.tar.bz2 rtmux-921991c98d6fd596c958b07b5f5aba7c434e8f9f.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index 806f1cbb..4fbdc4e7 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -478,6 +478,13 @@ cmdq_remove_group(struct cmdq_item *item) } } +/* Empty command callback. */ +static enum cmd_retval +cmdq_empty_command(__unused struct cmdq_item *item, __unused void *data) +{ + return (CMD_RETURN_NORMAL); +} + /* Get a command for the command queue. */ struct cmdq_item * cmdq_get_command(struct cmd_list *cmdlist, struct cmdq_state *state) @@ -487,12 +494,14 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmdq_state *state) const struct cmd_entry *entry; int created = 0; + if ((cmd = cmd_list_first(cmdlist)) == NULL) + return (cmdq_get_callback(cmdq_empty_command, NULL)); + if (state == NULL) { state = cmdq_new_state(NULL, NULL, 0); created = 1; } - cmd = cmd_list_first(cmdlist); while (cmd != NULL) { entry = cmd_get_entry(cmd); |