mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Detect failure from event_init() or event_base_new_with_config()
This commit is contained in:
parent
7363eae13c
commit
0f6c021617
@ -5,4 +5,5 @@
|
|||||||
bug 4457; workaround for Libevent versions 2.0.1-alpha through
|
bug 4457; workaround for Libevent versions 2.0.1-alpha through
|
||||||
2.0.15-stable.
|
2.0.15-stable.
|
||||||
|
|
||||||
|
- Detect failure to initialize Libevent. Better detection for bug 4457.
|
||||||
|
|
||||||
|
@ -179,6 +179,7 @@ tor_libevent_initialize(void)
|
|||||||
#ifdef HAVE_EVENT2_EVENT_H
|
#ifdef HAVE_EVENT2_EVENT_H
|
||||||
{
|
{
|
||||||
struct event_config *cfg = event_config_new();
|
struct event_config *cfg = event_config_new();
|
||||||
|
tor_assert(cfg);
|
||||||
|
|
||||||
/* In 0.2.2, we don't use locking at all. Telling Libevent not to try to
|
/* In 0.2.2, we don't use locking at all. Telling Libevent not to try to
|
||||||
* turn it on can avoid a needless socketpair() attempt.
|
* turn it on can avoid a needless socketpair() attempt.
|
||||||
@ -193,6 +194,11 @@ tor_libevent_initialize(void)
|
|||||||
the_event_base = event_init();
|
the_event_base = event_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!the_event_base) {
|
||||||
|
log_err(LD_GENERAL, "Unable to initialize Libevent: cannot continue.");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD)
|
#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD)
|
||||||
/* Making this a NOTICE for now so we can link bugs to a libevent versions
|
/* Making this a NOTICE for now so we can link bugs to a libevent versions
|
||||||
* or methods better. */
|
* or methods better. */
|
||||||
|
Loading…
Reference in New Issue
Block a user