s3:lib/events: add missing TEVENT_TRACE_BEFORE/AFTER_WAIT handling
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Feb 2013 09:54:21 +0000 (10:54 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 28 Feb 2013 11:05:36 +0000 (12:05 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/lib/events.c

index 011fcdc2e16cc96a333e1fc1963e314f2d02b2d0..3b7794b0ddeccc1bd3c645637be9d316366ff12e 100644 (file)
@@ -314,6 +314,7 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
        int timeout;
        int num_pfds;
        int ret;
+       int poll_errno;
 
        timeout = INT_MAX;
 
@@ -333,7 +334,12 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
                return -1;
        }
 
+       tevent_trace_point_callback(ev, TEVENT_TRACE_BEFORE_WAIT);
        ret = poll(state->pfds, num_pfds, timeout);
+       poll_errno = errno;
+       tevent_trace_point_callback(ev, TEVENT_TRACE_AFTER_WAIT);
+       errno = poll_errno;
+
        if (ret == -1 && errno != EINTR) {
                tevent_debug(ev, TEVENT_DEBUG_FATAL,
                             "poll() failed: %d:%s\n",