1
0
mirror of https://github.com/tmux/tmux.git synced 2025-03-29 02:08:48 +00:00

Use safe loop for freeing client files.

This commit is contained in:
Nicholas Marriott 2020-05-13 21:11:46 +01:00
parent e6d9f3f90c
commit 09a2246b00
2 changed files with 4 additions and 5 deletions

View File

@ -211,7 +211,6 @@ server_client_create(int fd)
c->queue = cmdq_new(); c->queue = cmdq_new();
c->tty.fd = -1; c->tty.fd = -1;
c->tty.sx = 80; c->tty.sx = 80;
c->tty.sy = 24; c->tty.sy = 24;
@ -270,7 +269,7 @@ server_client_open(struct client *c, char **cause)
void void
server_client_lost(struct client *c) server_client_lost(struct client *c)
{ {
struct client_file *cf; struct client_file *cf, *cf1;
c->flags |= CLIENT_DEAD; c->flags |= CLIENT_DEAD;
@ -278,7 +277,7 @@ server_client_lost(struct client *c)
status_prompt_clear(c); status_prompt_clear(c);
status_message_clear(c); status_message_clear(c);
RB_FOREACH(cf, client_files, &c->files) { RB_FOREACH_SAFE(cf, client_files, &c->files, cf1) {
cf->error = EINTR; cf->error = EINTR;
file_fire_done(cf); file_fire_done(cf);
} }
@ -2252,7 +2251,7 @@ server_client_set_flags(struct client *c, const char *flags)
} }
/*Get client flags. This is only flags useful to show to users. */ /* Get client flags. This is only flags useful to show to users. */
const char * const char *
server_client_get_flags(struct client *c) server_client_get_flags(struct client *c)
{ {

2
tmux.h
View File

@ -1506,7 +1506,7 @@ struct client_file {
client_file_cb cb; client_file_cb cb;
void *data; void *data;
RB_ENTRY (client_file) entry; RB_ENTRY(client_file) entry;
}; };
RB_HEAD(client_files, client_file); RB_HEAD(client_files, client_file);