From e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 11:27:00 +0100 Subject: tevent: add tevent_fd_set_close_fn() Let callers specify a close function as an alternative to TEVENT_FD_AUTOCLOSE. metze --- lib/tevent/tevent.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/tevent/tevent.c') diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c index 9319177646..93918cc14d 100644 --- a/lib/tevent/tevent.c +++ b/lib/tevent/tevent.c @@ -240,6 +240,16 @@ struct tevent_aio *_tevent_add_aio(struct tevent_context *ev, handler_name, location); } +/* + set a close function on the fd event +*/ +void tevent_fd_set_close_fn(struct tevent_fd *fde, + tevent_fd_close_fn_t close_fn) +{ + if (!fde) return; + fde->event_ctx->ops->set_fd_close_fn(fde, close_fn); +} + /* return the fd event flags */ -- cgit