diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-10-29 12:50:05 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-10-29 12:51:21 +0000 |
commit | 35ffd093d724053046ae49984af0beb0530e5560 (patch) | |
tree | d5b89a213621dc56b852fc7eb8a1daba12046830 /cmd-queue.c | |
parent | 201036ad80f2e51f7238db2adf05914a4a4f5819 (diff) | |
parent | 10a9440055ccdda5788965bcb048207eab2a0548 (diff) | |
download | rtmux-35ffd093d724053046ae49984af0beb0530e5560.tar.gz rtmux-35ffd093d724053046ae49984af0beb0530e5560.tar.bz2 rtmux-35ffd093d724053046ae49984af0beb0530e5560.zip |
Merge branch 'obsd-master'
Conflicts:
Makefile
cmd-link-window.c
cmd-unlink-window.c
Diffstat (limited to 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index 270ad771..f3186f2a 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -93,17 +93,16 @@ cmdq_error(struct cmd_q *cmdq, const char *fmt, ...) struct client *c = cmdq->client; struct cmd *cmd = cmdq->cmd; va_list ap; - char *msg, *cause; + char *msg; size_t msglen; va_start(ap, fmt); msglen = xvasprintf(&msg, fmt, ap); va_end(ap); - if (c == NULL) { - xasprintf(&cause, "%s:%u: %s", cmd->file, cmd->line, msg); - ARRAY_ADD(&cfg_causes, cause); - } else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { + if (c == NULL) + cfg_add_cause("%s:%u: %s", cmd->file, cmd->line, msg); + else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { evbuffer_add(c->stderr_data, msg, msglen); evbuffer_add(c->stderr_data, "\n", 1); @@ -180,8 +179,6 @@ cmdq_continue(struct cmd_q *cmdq) cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry); do { - next = TAILQ_NEXT(cmdq->item, qentry); - while (cmdq->cmd != NULL) { cmd_print(cmdq->cmd, s, sizeof s); log_debug("cmdq %p: %s (client %d)", cmdq, s, @@ -213,6 +210,7 @@ cmdq_continue(struct cmd_q *cmdq) cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry); } + next = TAILQ_NEXT(cmdq->item, qentry); TAILQ_REMOVE(&cmdq->queue, cmdq->item, qentry); cmd_list_free(cmdq->item->cmdlist); |