summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-02-11 10:48:02 -0800
committerJeremy Allison <jra@samba.org>2013-02-14 10:19:38 -0800
commit6f9819229b3d60cb898a0f9bfc67793b6c40fc2c (patch)
treeecc610353ac252eb719aab6ae136e16b083bd458
parent04ba47e491d84f58562b57f937be632e75c204aa (diff)
downloadsamba-6f9819229b3d60cb898a0f9bfc67793b6c40fc2c.tar.gz
samba-6f9819229b3d60cb898a0f9bfc67793b6c40fc2c.tar.bz2
samba-6f9819229b3d60cb898a0f9bfc67793b6c40fc2c.zip
tevent: Plumb in the panic fallback code into the epoll_panic() runtime call.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--lib/tevent/tevent_epoll.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index 8a48d1d33d..0ef1ffe909 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -71,9 +71,26 @@ _PRIVATE_ bool tevent_epoll_set_panic_fallback(struct tevent_context *ev,
static void epoll_panic(struct epoll_event_context *epoll_ev,
const char *reason, bool replay)
{
- tevent_debug(epoll_ev->ev, TEVENT_DEBUG_FATAL,
- "%s (%s) - calling abort()\n", reason, strerror(errno));
- abort();
+ struct tevent_context *ev = epoll_ev->ev;
+
+ if (epoll_ev->panic_fallback == NULL) {
+ tevent_debug(ev, TEVENT_DEBUG_FATAL,
+ "%s (%s) replay[%u] - calling abort()\n",
+ reason, strerror(errno), (unsigned)replay);
+ abort();
+ }
+
+ tevent_debug(ev, TEVENT_DEBUG_WARNING,
+ "%s (%s) replay[%u] - calling panic_fallback\n",
+ reason, strerror(errno), (unsigned)replay);
+
+ if (!epoll_ev->panic_fallback(ev, replay)) {
+ /* Fallback failed. */
+ tevent_debug(ev, TEVENT_DEBUG_FATAL,
+ "%s (%s) replay[%u] - calling abort()\n",
+ reason, strerror(errno), (unsigned)replay);
+ abort();
+ }
}
/*