tevent: pass __location__ to tevent_loop_once/wait()
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Mar 2009 08:33:26 +0000 (09:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Mar 2009 11:12:34 +0000 (12:12 +0100)
metze

lib/tevent/tevent.c
lib/tevent/tevent.h
lib/tevent/tevent_epoll.c
lib/tevent/tevent_internal.h
lib/tevent/tevent_select.c
lib/tevent/tevent_standard.c

index 943d4d6bc257fc276d7312f6096ed6f1941abf29..d7db303d879038f3e15994a116759a17b9cabc89 100644 (file)
@@ -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);
 }
index 90d0767f87bcb1eabf967fd53cc4d8069a3b1836..1870f695b5702a71325fbfbc83f25858ac1a9e7d 100644 (file)
@@ -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);
index 0494f55060b713fd375e32620c006c9e910d4466..b63d299d94272efec09d28c06c89a02720a7ce22 100644 (file)
@@ -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;
                }
        }
index 5a645ecb6082d1e5ddbce1ef140283cc437ed16b..151a34fc425f2cf890ab2035ab75160ba489608f 100644 (file)
@@ -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 {
index 32678f0a156ccbd517e709f0810f9846ac12a751..cdddb601c42ce78094a46280d869958e8e660ea7 100644 (file)
@@ -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;
                }
        }
index bbd5c5d78577f7d2b1486a1113b57491b4063375..73a45e8c20fe327d75d35b1b0fd1149c860f0f04 100644 (file)
@@ -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;
                }
        }