summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-09-16 22:24:55 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-09-16 22:24:55 +0000
commitbe4e4dd129be0242558cbefa0c3a1f256120a5ae (patch)
tree5bcabb0e47f05b5cebf38938734c4acc4c1b1696 /usr.bin
parent8073e621469aafeb655b353c980cc9c2e85c81a3 (diff)
Rename cmd_q dead flag to a general flags bitmask (will be more flags later).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-if-shell.c4
-rw-r--r--usr.bin/tmux/cmd-queue.c11
-rw-r--r--usr.bin/tmux/cmd-run-shell.c4
-rw-r--r--usr.bin/tmux/server-client.c4
-rw-r--r--usr.bin/tmux/tmux.h5
5 files changed, 16 insertions, 12 deletions
diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c
index 507ecb5a4a0..fdac5bd188e 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.32 2015/04/24 22:19:36 nicm Exp $ */
+/* $OpenBSD: cmd-if-shell.c,v 1.33 2015/09/16 22:24:54 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -143,7 +143,7 @@ cmd_if_shell_callback(struct job *job)
struct cmd_list *cmdlist;
char *cause, *cmd;
- if (cmdq->dead)
+ if (cmdq->flags & CMD_Q_DEAD)
return;
if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0)
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c
index 72ed7fbb908..b010ff78294 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.24 2015/06/17 17:02:15 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.25 2015/09/16 22:24:54 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -35,7 +35,7 @@ cmdq_new(struct client *c)
cmdq = xcalloc(1, sizeof *cmdq);
cmdq->references = 1;
- cmdq->dead = 0;
+ cmdq->flags = 0;
cmdq->client = c;
cmdq->client_exit = -1;
@@ -51,8 +51,11 @@ cmdq_new(struct client *c)
int
cmdq_free(struct cmd_q *cmdq)
{
- if (--cmdq->references != 0)
- return (cmdq->dead);
+ if (--cmdq->references != 0) {
+ if (cmdq->flags & CMD_Q_DEAD)
+ return (1);
+ return (0);
+ }
cmdq_flush(cmdq);
free(cmdq);
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index 6fac94f519d..32ee362a8d1 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.28 2015/04/24 22:19:36 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.29 2015/09/16 22:24:54 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -131,7 +131,7 @@ cmd_run_shell_callback(struct job *job)
int retcode;
u_int lines;
- if (cmdq->dead)
+ if (cmdq->flags & CMD_Q_DEAD)
return;
cmd = cdata->cmd;
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index d6bd2320abc..332071d2b1c 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.153 2015/09/14 10:25:52 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.154 2015/09/16 22:24:54 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -214,7 +214,7 @@ server_client_lost(struct client *c)
free(c->prompt_string);
free(c->prompt_buffer);
- c->cmdq->dead = 1;
+ c->cmdq->flags |= CMD_Q_DEAD;
cmdq_free(c->cmdq);
c->cmdq = NULL;
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 16e01fcae01..11b861a0e5c 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.560 2015/09/14 11:57:22 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.561 2015/09/16 22:24:54 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1305,7 +1305,8 @@ TAILQ_HEAD(cmd_q_items, cmd_q_item);
/* Command queue. */
struct cmd_q {
int references;
- int dead;
+ int flags;
+#define CMD_Q_DEAD 0x1
struct client *client;
int client_exit;