From af4ce4805ce1504fc8869ead032eabb72fca77a0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Jan 2005 01:51:45 +0000 Subject: r4954: we don't need the separate event_remove_*() calls any more, as you now remove an event by calling talloc_free(). (This used to be commit 8f19b6886cc58a56d52aecfc83a175197061e533) --- source4/lib/events.c | 38 ++------------------------------------ source4/libcli/raw/clitransport.c | 2 +- 2 files changed, 3 insertions(+), 37 deletions(-) (limited to 'source4') diff --git a/source4/lib/events.c b/source4/lib/events.c index a484295d8b..d32a1344e0 100644 --- a/source4/lib/events.c +++ b/source4/lib/events.c @@ -55,7 +55,7 @@ 'struct event_context' that you use in all subsequent calls. After that you can add/remove events that you are interested in - using event_add_*() and event_remove_*(). + using event_add_*() and talloc_free() Finally, you call event_loop_wait() to block waiting for one of the events to occor. In normal operation event_loop_wait() will loop @@ -176,18 +176,6 @@ struct fd_event *event_add_fd(struct event_context *ev, struct fd_event *e0, } -/* - remove a fd based event - the event to remove is matched by looking at the handler - function and the file descriptor - return False on failure (event not found) -*/ -BOOL event_remove_fd(struct event_context *ev, struct fd_event *e1) -{ - talloc_free(e1); - return True; -} - /* remove all fd based events that match a specified fd */ @@ -245,16 +233,6 @@ struct timed_event *event_add_timed(struct event_context *ev, struct timed_event return e; } -/* - remove a timed event - return False on failure (event not found) -*/ -BOOL event_remove_timed(struct event_context *ev, struct timed_event *e) -{ - talloc_free(e); - return True; -} - static int event_loop_destructor(void *ptr) { struct loop_event *le = talloc_get_type(ptr, struct loop_event); @@ -282,18 +260,6 @@ struct loop_event *event_add_loop(struct event_context *ev, struct loop_event *e return e; } -/* - remove a loop event - the event to remove is matched only on the handler function - return False on failure (memory allocation error) -*/ -BOOL event_remove_loop(struct event_context *ev, struct loop_event *e) -{ - talloc_free(e); - return True; -} - - /* tell the event loop to exit with the specified code */ @@ -413,7 +379,7 @@ int event_loop_once(struct event_context *ev) if (timeval_compare(&te->next_event, &t) >= 0) { /* the handler didn't set a time for the next event - remove the event */ - event_remove_timed(ev, te); + talloc_free(te); } } te = next; diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index c993fd7e60..1904618be9 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -318,7 +318,7 @@ void smbcli_transport_idle_handler(struct smbcli_transport *transport, transport->idle.period = period; if (transport->socket->event.te != NULL) { - event_remove_timed(transport->socket->event.ctx, transport->socket->event.te); + talloc_free(transport->socket->event.te); } te.next_event = timeval_current_ofs(0, period); -- cgit