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:
Tiago Cunha
2012-03-18 01:59:34 +00:00
parent 5aa28473dd
commit 0987d55231
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) {