summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2015-09-16 22:24:54 +0000
committernicm <nicm>2015-09-16 22:24:54 +0000
commita4b4b299875d833019cb829ca1bee41d71724f37 (patch)
treedd87a7c2c05f91af465327d91b28e0d469aaf883
parent16ee4de5df3c31e362ed095e3feae1b504ddf1c5 (diff)
Rename cmd_q dead flag to a general flags bitmask (will be more flags later).
-rw-r--r--cmd-if-shell.c2
-rw-r--r--cmd-queue.c9
-rw-r--r--cmd-run-shell.c2
-rw-r--r--server-client.c2
-rw-r--r--tmux.h3
5 files changed, 11 insertions, 7 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index a307bd2f..0271fdea 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -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/cmd-queue.c b/cmd-queue.c
index af987f59..217045fa 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -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/cmd-run-shell.c b/cmd-run-shell.c
index 134cbeba..17ac0f76 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -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/server-client.c b/server-client.c
index 6669bf05..10768839 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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/tmux.h b/tmux.h
index 6839be84..3fd057e9 100644
--- a/tmux.h
+++ b/tmux.h
@@ -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;