diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-03-17 18:24:08 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-03-17 18:24:08 +0000 |
commit | 68920a758325f7a7c215970f73e7978e42648041 (patch) | |
tree | 98ee7ef8c1b9643a1af1c2f41c36a32bc894c382 /usr.bin/tmux/tty.c | |
parent | 900cf287b7ea95653f2f0865008aa6d932b76e3e (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 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 135d22bde50..11b50f4f6fd 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.122 2012/03/17 17:36:03 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.123 2012/03/17 18:24:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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) { |