diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-03-17 18:24:07 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-03-17 18:24:07 +0000 |
commit | d3c842d3678e52275c944123f00a2a974eb5d965 (patch) | |
tree | d0b234a4364504e17f53d90aa3e635134c0f01cc /tty.c | |
parent | a597e3546cf667c2db91aea5545d2cb2125366f5 (diff) |
Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) { |