commit db1e7fc69bb10370dd5ea720ecfcfd466a69bbb7 from: Omar Polo date: Fri Jul 16 08:45:10 2021 UTC initialize events: prevents libevent2 from crashing clechoev and resizeev are two globally defined event, and thus guaranteed to be zeroed. While OpenBSD' libevent1 is fine when calling event_pending on such events, libevent2 complains and, probably depending on which flags were used, crashes. Prompted and tested by Andrea Feletto, thanks! commit - a1e5a814946390aac545d5ad478b1adb6ff5f112 commit + db1e7fc69bb10370dd5ea720ecfcfd466a69bbb7 blob - 692b3acb5729ed62f42cd74e64129baa3362b8dd blob + 3d9ae7c7a7c78a09dcc103d0f06b177b4abc5d4c --- ui.c +++ ui.c @@ -1236,6 +1236,15 @@ ui_init() mvwprintw(body, 0, 0, ""); + /* + * Dummy so libevent2 won't complain that no event_base is set + * when checking event_pending for the first time + */ + evtimer_set(&clechoev, handle_clear_echoarea, NULL); + evtimer_add(&clechoev, &clechoev_timer); + evtimer_set(&resizeev, handle_resize, NULL); + evtimer_add(&resizeev, &resize_timer); + event_set(&stdioev, 0, EV_READ | EV_PERSIST, dispatch_stdio, NULL); event_add(&stdioev, NULL);