aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-14 17:59:42 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-14 17:59:42 -0500
commitcf8117136c1b206e727d582a4c378ce53e058414 (patch)
tree87e9d21ec81962574b4ce69283c9c3972f3e4a8a /src/common/compat_libevent.c
parent8592126a184c5f80e3213085d666362f21320df0 (diff)
parent0f6c02161793fa1022fe721ed9c1aac3538294b3 (diff)
downloadtor-cf8117136c1b206e727d582a4c378ce53e058414.tar
tor-cf8117136c1b206e727d582a4c378ce53e058414.tar.gz
Merge remote-tracking branch 'public/bug4457_022' into bug4457_master
Conflicts: src/common/compat_libevent.c Resolving conflict by not taking 7363eae13cb8 ("Use the EVENT_BASE_FLAG_NOLOCK flag to prevent socketpair() invocation"): in Tor 0.2.3.x, we _do_ sometimes use notifiable event bases.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 320173870..c53346118 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -196,6 +196,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
#ifdef HAVE_EVENT2_EVENT_H
{
struct event_config *cfg = event_config_new();
+ tor_assert(cfg);
#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
if (! torcfg->disable_iocp) {
@@ -224,6 +225,11 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
the_event_base = event_init();
#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)
/* Making this a NOTICE for now so we can link bugs to a libevent versions
* or methods better. */