diff options
-rw-r--r-- | source4/lib/events.c | 38 | ||||
-rw-r--r-- | source4/libcli/raw/clitransport.c | 2 |
2 files changed, 3 insertions, 37 deletions
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 @@ -177,18 +177,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 */ void event_remove_fd_all(struct event_context *ev, int 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); @@ -283,18 +261,6 @@ struct loop_event *event_add_loop(struct event_context *ev, struct loop_event *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 */ void event_loop_exit(struct event_context *ev, int 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); |