summaryrefslogtreecommitdiffstats
path: root/cmd-queue.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-06-23 12:41:54 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-06-23 12:41:54 +0000
commit662d471215d66d3c44a9251cef7d00b25587851d (patch)
treeb740b3c24d890d72c68212bc8d1c570a89ea7ce9 /cmd-queue.c
parentd6debc21c777dc0e993fd7928bbba51075685491 (diff)
Mark control commands specially so the client can identify them, based
on a diff from George Nachman a while back.
Diffstat (limited to 'cmd-queue.c')
-rw-r--r--cmd-queue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index a64d332c..904b092c 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -157,14 +157,17 @@ int
cmdq_guard(struct cmd_q *cmdq, const char *guard)
{
struct client *c = cmdq->client;
+ int flags;
if (c == NULL)
return 0;
if (!(c->flags & CLIENT_CONTROL))
return 0;
- evbuffer_add_printf(c->stdout_data, "%%%s %ld %u\n", guard,
- (long) cmdq->time, cmdq->number);
+ flags = !!(cmdq->cmd->flags & CMD_CONTROL);
+
+ evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard,
+ (long) cmdq->time, cmdq->number, flags);
server_push_stdout(c);
return 1;
}