summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/names.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-03-17 18:24:07 +0000
committernicm <nicm@openbsd.org>2012-03-17 18:24:07 +0000
commit346357b798ef0748da3b6bdd1c273831780b783f (patch)
tree5fa368b6618858af7d029dffd2ab840ea7108706 /usr.bin/tmux/names.c
parentRedirect libevent logging to tmux's log. (diff)
downloadwireguard-openbsd-346357b798ef0748da3b6bdd1c273831780b783f.tar.xz
wireguard-openbsd-346357b798ef0748da3b6bdd1c273831780b783f.zip
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/names.c')
-rw-r--r--usr.bin/tmux/names.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/names.c b/usr.bin/tmux/names.c
index 9d1accfabe4..73be30c24f4 100644
--- a/usr.bin/tmux/names.c
+++ b/usr.bin/tmux/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.12 2012/03/09 21:11:28 nicm Exp $ */
+/* $OpenBSD: names.c,v 1.13 2012/03/17 18:24:07 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}