]> granicus.if.org Git - libevent/commit
Mark the event_err() functions as __attribute__((noreturn))
authorNick Mathewson <nickm@torproject.org>
Thu, 13 May 2010 14:57:30 +0000 (10:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 13 May 2010 19:39:02 +0000 (15:39 -0400)
commit33bbbed9dde90b68d3bf88dca1f21b557425db4b
tree4b12ad76a67bbe71077ad3051c143a3f1061844d
parentdfb75ab207f105c780a9819414c78f235548773d
Mark the event_err() functions as __attribute__((noreturn))

This attribute tells gcc (and anything else that understands gcc
attributes) that the functions will never return control, and helps
the optimizer a little.  With luck, it will also tell
less-than-full-program dataflow analysis tools that they don't need to
worry about any code path that involves calling one of these functions
and then returning.

This patch also forces event_exit() to always exit, no matter what the
user-supplied fatal_callback does.  This means that the old unit tests
for the event_err* functions don't work any more, since they assume it
is safe to call event_err* if you've given it a bogus fatal_callback
that doesn't exit.  Instead, we have to make the unit tests fork
before calling event_err(), and have the main unit test process wait
for the event_err() test to exit with a sane exit code.  On unix,
that's trivial.  On windows, let's not bother and just assume that
event_err* works.
log-internal.h
log.c
test/regress_util.c