diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-06-18 11:08:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-06-18 11:08:43 +0000 |
commit | daa4ae70b4a66a81d82685bff63fdfbad2450968 (patch) | |
tree | 70e809dbb8f9bd264e580825196decafbc8be55d /usr.bin | |
parent | 3767cb0f61a555d2d3b2ef881eb9b87a70589018 (diff) |
Add a cmdq_continue function rather than twiddling the flag directly.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cfg.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-display-panes.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-if-shell.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-load-buffer.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-queue.c | 9 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-run-shell.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-wait-for.c | 10 | ||||
-rw-r--r-- | usr.bin/tmux/menu.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 | ||||
-rw-r--r-- | usr.bin/tmux/window.c | 4 |
10 files changed, 29 insertions, 21 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c index 852489dd3c8..41bcb6d539d 100644 --- a/usr.bin/tmux/cfg.c +++ b/usr.bin/tmux/cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.73 2019/06/05 20:00:53 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.74 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -53,7 +53,7 @@ cfg_done(__unused struct cmdq_item *item, __unused void *data) cfg_show_causes(RB_MIN(sessions, &sessions)); if (cfg_item != NULL) - cfg_item->flags &= ~CMDQ_WAITING; + cmdq_continue(cfg_item); status_prompt_load_history(); diff --git a/usr.bin/tmux/cmd-display-panes.c b/usr.bin/tmux/cmd-display-panes.c index 6314260f44f..ddaab2df4ef 100644 --- a/usr.bin/tmux/cmd-display-panes.c +++ b/usr.bin/tmux/cmd-display-panes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-panes.c,v 1.27 2019/05/23 11:13:30 nicm Exp $ */ +/* $OpenBSD: cmd-display-panes.c,v 1.28 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -188,7 +188,7 @@ cmd_display_panes_free(struct client *c) struct cmd_display_panes_data *cdata = c->overlay_data; if (cdata->item != NULL) - cdata->item->flags &= ~CMDQ_WAITING; + cmdq_continue(cdata->item); free(cdata->command); free(cdata); } diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c index 7c366f3c179..0f75678a165 100644 --- a/usr.bin/tmux/cmd-if-shell.c +++ b/usr.bin/tmux/cmd-if-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-if-shell.c,v 1.63 2019/06/12 08:47:07 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.64 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -196,7 +196,7 @@ cmd_if_shell_callback(struct job *job) out: if (cdata->item != NULL) - cdata->item->flags &= ~CMDQ_WAITING; + cmdq_continue(cdata->item); } static void diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index 13e7ff56511..0f4622058ac 100644 --- a/usr.bin/tmux/cmd-load-buffer.c +++ b/usr.bin/tmux/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.55 2019/06/13 21:44:13 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.56 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -176,7 +176,7 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data) free(cause); } out: - cdata->item->flags &= ~CMDQ_WAITING; + cmdq_continue(cdata->item); free(cdata->bufname); free(cdata); diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index a1683aa35fb..f38907870b5 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.73 2019/05/31 21:41:17 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.74 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -156,6 +156,13 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item, free(name); } +/* Continue processing command queue. */ +void +cmdq_continue(struct cmdq_item *item) +{ + item->flags &= ~CMDQ_WAITING; +} + /* Remove an item. */ static void cmdq_remove(struct cmdq_item *item) diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c index f22d9b3ae43..a484fcd5a94 100644 --- a/usr.bin/tmux/cmd-run-shell.c +++ b/usr.bin/tmux/cmd-run-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-run-shell.c,v 1.58 2019/03/12 11:16:50 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.59 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -155,7 +155,7 @@ cmd_run_shell_callback(struct job *job) free(msg); if (cdata->item != NULL) - cdata->item->flags &= ~CMDQ_WAITING; + cmdq_continue(cdata->item); } static void diff --git a/usr.bin/tmux/cmd-wait-for.c b/usr.bin/tmux/cmd-wait-for.c index 63f160ffc93..ef9a2e899e0 100644 --- a/usr.bin/tmux/cmd-wait-for.c +++ b/usr.bin/tmux/cmd-wait-for.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-wait-for.c,v 1.17 2018/11/07 07:58:16 nicm Exp $ */ +/* $OpenBSD: cmd-wait-for.c,v 1.18 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -153,7 +153,7 @@ cmd_wait_for_signal(__unused struct cmdq_item *item, const char *name, log_debug("signal wait channel %s, with waiters", wc->name); TAILQ_FOREACH_SAFE(wi, &wc->waiters, entry, wi1) { - wi->item->flags &= ~CMDQ_WAITING; + cmdq_continue(wi->item); TAILQ_REMOVE(&wc->waiters, wi, entry); free(wi); @@ -229,7 +229,7 @@ cmd_wait_for_unlock(struct cmdq_item *item, const char *name, } if ((wi = TAILQ_FIRST(&wc->lockers)) != NULL) { - wi->item->flags &= ~CMDQ_WAITING; + cmdq_continue(wi->item); TAILQ_REMOVE(&wc->lockers, wi, entry); free(wi); } else { @@ -248,13 +248,13 @@ cmd_wait_for_flush(void) RB_FOREACH_SAFE(wc, wait_channels, &wait_channels, wc1) { TAILQ_FOREACH_SAFE(wi, &wc->waiters, entry, wi1) { - wi->item->flags &= ~CMDQ_WAITING; + cmdq_continue(wi->item); TAILQ_REMOVE(&wc->waiters, wi, entry); free(wi); } wc->woken = 1; TAILQ_FOREACH_SAFE(wi, &wc->lockers, entry, wi1) { - wi->item->flags &= ~CMDQ_WAITING; + cmdq_continue(wi->item); TAILQ_REMOVE(&wc->lockers, wi, entry); free(wi); } diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index b60df9d0b47..69b7b228825 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.9 2019/05/28 09:50:54 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.10 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -161,7 +161,7 @@ menu_free_cb(struct client *c) struct menu_data *md = c->overlay_data; if (md->item != NULL) - md->item->flags &= ~CMDQ_WAITING; + cmdq_continue(md->item); if (md->cb != NULL) md->cb(md->menu, UINT_MAX, KEYC_NONE, md->data); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 51c421f033e..2a443008a12 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.911 2019/06/13 19:46:00 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.912 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -2037,6 +2037,7 @@ void cmdq_insert_after(struct cmdq_item *, struct cmdq_item *); void cmdq_append(struct client *, struct cmdq_item *); void cmdq_insert_hook(struct session *, struct cmdq_item *, struct cmd_find_state *, const char *, ...); +void cmdq_continue(struct cmdq_item *); void printflike(3, 4) cmdq_format(struct cmdq_item *, const char *, const char *, ...); u_int cmdq_next(struct client *); diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 103c6e30c13..7721514c59c 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.232 2019/06/13 19:46:00 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.233 2019/06/18 11:08:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1512,7 +1512,7 @@ window_pane_input_callback(struct client *c, int closed, void *data) c->stdin_callback = NULL; server_client_unref(c); - cdata->item->flags &= ~CMDQ_WAITING; + cmdq_continue(cdata->item); free(cdata); return; |