mirror of
https://github.com/tmux/tmux.git
synced 2024-11-10 13:48:48 +00:00
Sync OpenBSD patchset 1057:
Check event_initialized before event_del if event may not have been set up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
This commit is contained in:
parent
5aa28473dd
commit
0987d55231
3
names.c
3
names.c
@ -36,7 +36,8 @@ queue_window_name(struct window *w)
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = NAME_INTERVAL * 1000L;
|
||||
|
||||
evtimer_del(&w->name_timer);
|
||||
if (event_initialized(&w->name_timer))
|
||||
evtimer_del(&w->name_timer);
|
||||
evtimer_set(&w->name_timer, window_name_callback, w);
|
||||
evtimer_add(&w->name_timer, &tv);
|
||||
}
|
||||
|
@ -152,11 +152,13 @@ server_client_lost(struct client *c)
|
||||
|
||||
evtimer_del(&c->repeat_timer);
|
||||
|
||||
evtimer_del(&c->identify_timer);
|
||||
if (event_initialized(&c->identify_timer))
|
||||
evtimer_del(&c->identify_timer);
|
||||
|
||||
if (c->message_string != NULL)
|
||||
xfree(c->message_string);
|
||||
evtimer_del(&c->message_timer);
|
||||
if (event_initialized (&c->message_timer))
|
||||
evtimer_del(&c->message_timer);
|
||||
for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) {
|
||||
msg = &ARRAY_ITEM(&c->message_log, i);
|
||||
xfree(msg->msg);
|
||||
@ -175,7 +177,8 @@ server_client_lost(struct client *c)
|
||||
|
||||
close(c->ibuf.fd);
|
||||
imsg_clear(&c->ibuf);
|
||||
event_del(&c->event);
|
||||
if (event_initialized(&c->event))
|
||||
event_del(&c->event);
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH(&dead_clients); i++) {
|
||||
if (ARRAY_ITEM(&dead_clients, i) == NULL) {
|
||||
|
@ -453,7 +453,8 @@ server_set_identify(struct client *c)
|
||||
tv.tv_sec = delay / 1000;
|
||||
tv.tv_usec = (delay % 1000) * 1000L;
|
||||
|
||||
evtimer_del(&c->identify_timer);
|
||||
if (event_initialized (&c->identify_timer))
|
||||
evtimer_del(&c->identify_timer);
|
||||
evtimer_set(&c->identify_timer, server_callback_identify, c);
|
||||
evtimer_add(&c->identify_timer, &tv);
|
||||
|
||||
@ -491,7 +492,8 @@ server_update_event(struct client *c)
|
||||
events |= EV_READ;
|
||||
if (c->ibuf.w.queued > 0)
|
||||
events |= EV_WRITE;
|
||||
event_del(&c->event);
|
||||
if (event_initialized(&c->event))
|
||||
event_del(&c->event);
|
||||
event_set(&c->event, c->ibuf.fd, events, server_client_callback, c);
|
||||
event_add(&c->event, NULL);
|
||||
}
|
||||
|
3
status.c
3
status.c
@ -776,7 +776,8 @@ status_message_set(struct client *c, const char *fmt, ...)
|
||||
tv.tv_sec = delay / 1000;
|
||||
tv.tv_usec = (delay % 1000) * 1000L;
|
||||
|
||||
evtimer_del(&c->message_timer);
|
||||
if (event_initialized (&c->message_timer))
|
||||
evtimer_del(&c->message_timer);
|
||||
evtimer_set(&c->message_timer, status_message_callback, c);
|
||||
evtimer_add(&c->message_timer, &tv);
|
||||
|
||||
|
@ -549,7 +549,8 @@ start_timer:
|
||||
tv.tv_sec = delay / 1000;
|
||||
tv.tv_usec = (delay % 1000) * 1000L;
|
||||
|
||||
evtimer_del(&tty->key_timer);
|
||||
if (event_initialized(&tty->key_timer))
|
||||
evtimer_del(&tty->key_timer);
|
||||
evtimer_set(&tty->key_timer, tty_keys_callback, tty);
|
||||
evtimer_add(&tty->key_timer, &tv);
|
||||
|
||||
@ -573,7 +574,8 @@ found_key:
|
||||
goto handle_key;
|
||||
|
||||
handle_key:
|
||||
evtimer_del(&tty->key_timer);
|
||||
if (event_initialized(&tty->key_timer))
|
||||
evtimer_del(&tty->key_timer);
|
||||
|
||||
if (key != KEYC_NONE)
|
||||
tty->key_callback(key, &mouse, tty->key_data);
|
||||
|
3
tty.c
3
tty.c
@ -279,7 +279,8 @@ tty_close(struct tty *tty)
|
||||
tty->log_fd = -1;
|
||||
}
|
||||
|
||||
evtimer_del(&tty->key_timer);
|
||||
if (event_initialized(&tty->key_timer))
|
||||
evtimer_del(&tty->key_timer);
|
||||
tty_stop_tty(tty);
|
||||
|
||||
if (tty->flags & TTY_OPENED) {
|
||||
|
Loading…
Reference in New Issue
Block a user