forked from libevent/libevent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
dfb75ab
commit 33bbbed
Showing
3 changed files
with
82 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters