mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Rename cmd_q dead flag to a general flags bitmask (will be more flags later).
This commit is contained in:
parent
16ee4de5df
commit
a4b4b29987
@ -143,7 +143,7 @@ cmd_if_shell_callback(struct job *job)
|
|||||||
struct cmd_list *cmdlist;
|
struct cmd_list *cmdlist;
|
||||||
char *cause, *cmd;
|
char *cause, *cmd;
|
||||||
|
|
||||||
if (cmdq->dead)
|
if (cmdq->flags & CMD_Q_DEAD)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0)
|
if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0)
|
||||||
|
@ -35,7 +35,7 @@ cmdq_new(struct client *c)
|
|||||||
|
|
||||||
cmdq = xcalloc(1, sizeof *cmdq);
|
cmdq = xcalloc(1, sizeof *cmdq);
|
||||||
cmdq->references = 1;
|
cmdq->references = 1;
|
||||||
cmdq->dead = 0;
|
cmdq->flags = 0;
|
||||||
|
|
||||||
cmdq->client = c;
|
cmdq->client = c;
|
||||||
cmdq->client_exit = -1;
|
cmdq->client_exit = -1;
|
||||||
@ -51,8 +51,11 @@ cmdq_new(struct client *c)
|
|||||||
int
|
int
|
||||||
cmdq_free(struct cmd_q *cmdq)
|
cmdq_free(struct cmd_q *cmdq)
|
||||||
{
|
{
|
||||||
if (--cmdq->references != 0)
|
if (--cmdq->references != 0) {
|
||||||
return (cmdq->dead);
|
if (cmdq->flags & CMD_Q_DEAD)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
cmdq_flush(cmdq);
|
cmdq_flush(cmdq);
|
||||||
free(cmdq);
|
free(cmdq);
|
||||||
|
@ -131,7 +131,7 @@ cmd_run_shell_callback(struct job *job)
|
|||||||
int retcode;
|
int retcode;
|
||||||
u_int lines;
|
u_int lines;
|
||||||
|
|
||||||
if (cmdq->dead)
|
if (cmdq->flags & CMD_Q_DEAD)
|
||||||
return;
|
return;
|
||||||
cmd = cdata->cmd;
|
cmd = cdata->cmd;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ server_client_lost(struct client *c)
|
|||||||
free(c->prompt_string);
|
free(c->prompt_string);
|
||||||
free(c->prompt_buffer);
|
free(c->prompt_buffer);
|
||||||
|
|
||||||
c->cmdq->dead = 1;
|
c->cmdq->flags |= CMD_Q_DEAD;
|
||||||
cmdq_free(c->cmdq);
|
cmdq_free(c->cmdq);
|
||||||
c->cmdq = NULL;
|
c->cmdq = NULL;
|
||||||
|
|
||||||
|
3
tmux.h
3
tmux.h
@ -1305,7 +1305,8 @@ TAILQ_HEAD(cmd_q_items, cmd_q_item);
|
|||||||
/* Command queue. */
|
/* Command queue. */
|
||||||
struct cmd_q {
|
struct cmd_q {
|
||||||
int references;
|
int references;
|
||||||
int dead;
|
int flags;
|
||||||
|
#define CMD_Q_DEAD 0x1
|
||||||
|
|
||||||
struct client *client;
|
struct client *client;
|
||||||
int client_exit;
|
int client_exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user