From 9932fd2d9af3c71262c5cca61c3b38809b952d95 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 12 Mar 2009 09:33:26 +0100 Subject: tevent: pass __location__ to tevent_loop_once/wait() metze --- lib/tevent/tevent.c | 8 ++++---- lib/tevent/tevent.h | 9 +++++++-- lib/tevent/tevent_epoll.c | 6 +++--- lib/tevent/tevent_internal.h | 4 ++-- lib/tevent/tevent_select.c | 6 +++--- lib/tevent/tevent_standard.c | 6 +++--- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c index 943d4d6bc2..d7db303d87 100644 --- a/lib/tevent/tevent.c +++ b/lib/tevent/tevent.c @@ -371,15 +371,15 @@ struct tevent_signal *_tevent_add_signal(struct tevent_context *ev, /* do a single event loop using the events defined in ev */ -int tevent_loop_once(struct tevent_context *ev) +int _tevent_loop_once(struct tevent_context *ev, const char *location) { - return ev->ops->loop_once(ev); + return ev->ops->loop_once(ev, location); } /* return on failure or (with 0) if all fd events are removed */ -int tevent_loop_wait(struct tevent_context *ev) +int _tevent_loop_wait(struct tevent_context *ev, const char *location) { - return ev->ops->loop_wait(ev); + return ev->ops->loop_wait(ev, location); } diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h index 90d0767f87..1870f695b5 100644 --- a/lib/tevent/tevent.h +++ b/lib/tevent/tevent.h @@ -99,8 +99,13 @@ struct tevent_signal *_tevent_add_signal(struct tevent_context *ev, _tevent_add_signal(ev, mem_ctx, signum, sa_flags, handler, private_data, \ #handler, __location__) -int tevent_loop_once(struct tevent_context *ev); -int tevent_loop_wait(struct tevent_context *ev); +int _tevent_loop_once(struct tevent_context *ev, const char *location); +#define tevent_loop_once(ev) \ + _tevent_loop_once(ev, __location__) \ + +int _tevent_loop_wait(struct tevent_context *ev, const char *location); +#define tevent_loop_wait(ev) \ + _tevent_loop_wait(ev, __location__) \ void tevent_fd_set_close_fn(struct tevent_fd *fde, tevent_fd_close_fn_t close_fn); diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c index 0494f55060..b63d299d94 100644 --- a/lib/tevent/tevent_epoll.c +++ b/lib/tevent/tevent_epoll.c @@ -411,7 +411,7 @@ static void epoll_event_set_fd_flags(struct tevent_fd *fde, uint16_t flags) /* do a single event loop using the events defined in ev */ -static int epoll_event_loop_once(struct tevent_context *ev) +static int epoll_event_loop_once(struct tevent_context *ev, const char *location) { struct epoll_event_context *epoll_ev = talloc_get_type(ev->additional_data, struct epoll_event_context); @@ -430,12 +430,12 @@ static int epoll_event_loop_once(struct tevent_context *ev) /* return on failure or (with 0) if all fd events are removed */ -static int epoll_event_loop_wait(struct tevent_context *ev) +static int epoll_event_loop_wait(struct tevent_context *ev, const char *location) { struct epoll_event_context *epoll_ev = talloc_get_type(ev->additional_data, struct epoll_event_context); while (epoll_ev->ev->fd_events) { - if (epoll_event_loop_once(ev) != 0) { + if (epoll_event_loop_once(ev, location) != 0) { break; } } diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h index 5a645ecb60..151a34fc42 100644 --- a/lib/tevent/tevent_internal.h +++ b/lib/tevent/tevent_internal.h @@ -153,8 +153,8 @@ struct tevent_ops { const char *location); /* loop functions */ - int (*loop_once)(struct tevent_context *ev); - int (*loop_wait)(struct tevent_context *ev); + int (*loop_once)(struct tevent_context *ev, const char *location); + int (*loop_wait)(struct tevent_context *ev, const char *location); }; struct tevent_fd { diff --git a/lib/tevent/tevent_select.c b/lib/tevent/tevent_select.c index 32678f0a15..cdddb601c4 100644 --- a/lib/tevent/tevent_select.c +++ b/lib/tevent/tevent_select.c @@ -213,7 +213,7 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru /* do a single event loop using the events defined in ev */ -static int select_event_loop_once(struct tevent_context *ev) +static int select_event_loop_once(struct tevent_context *ev, const char *location) { struct select_event_context *select_ev = talloc_get_type(ev->additional_data, struct select_event_context); @@ -230,14 +230,14 @@ static int select_event_loop_once(struct tevent_context *ev) /* return on failure or (with 0) if all fd events are removed */ -static int select_event_loop_wait(struct tevent_context *ev) +static int select_event_loop_wait(struct tevent_context *ev, const char *location) { struct select_event_context *select_ev = talloc_get_type(ev->additional_data, struct select_event_context); select_ev->exit_code = 0; while (ev->fd_events && select_ev->exit_code == 0) { - if (select_event_loop_once(ev) != 0) { + if (select_event_loop_once(ev, location) != 0) { break; } } diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c index bbd5c5d785..73a45e8c20 100644 --- a/lib/tevent/tevent_standard.c +++ b/lib/tevent/tevent_standard.c @@ -534,7 +534,7 @@ static int std_event_loop_select(struct std_event_context *std_ev, struct timeva /* do a single event loop using the events defined in ev */ -static int std_event_loop_once(struct tevent_context *ev) +static int std_event_loop_once(struct tevent_context *ev, const char *location) { struct std_event_context *std_ev = talloc_get_type(ev->additional_data, struct std_event_context); @@ -557,14 +557,14 @@ static int std_event_loop_once(struct tevent_context *ev) /* return on failure or (with 0) if all fd events are removed */ -static int std_event_loop_wait(struct tevent_context *ev) +static int std_event_loop_wait(struct tevent_context *ev, const char *location) { struct std_event_context *std_ev = talloc_get_type(ev->additional_data, struct std_event_context); std_ev->exit_code = 0; while (ev->fd_events && std_ev->exit_code == 0) { - if (std_event_loop_once(ev) != 0) { + if (std_event_loop_once(ev, location) != 0) { break; } } -- cgit