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:
Nicholas Marriott
2012-03-17 18:24:07 +00:00
parent a597e3546c
commit d3c842d367
7 changed files with 22 additions and 11 deletions

3
tty.c
View File

@ -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) {