summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tevent/tevent_poll.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c
index fcf97c4649..b6265fd3d0 100644
--- a/lib/tevent/tevent_poll.c
+++ b/lib/tevent/tevent_poll.c
@@ -55,6 +55,22 @@ struct poll_event_context {
int exit_code;
};
+static int poll_event_mt_destructor(struct poll_event_context *poll_ev)
+{
+ if (poll_ev->signal_fd != -1) {
+ close(poll_ev->signal_fd);
+ poll_ev->signal_fd = -1;
+ }
+ if (poll_ev->num_fds == 0) {
+ return 0;
+ }
+ if (poll_ev->fds[0].fd != -1) {
+ close(poll_ev->fds[0].fd);
+ poll_ev->fds[0].fd = -1;
+ }
+ return 0;
+}
+
/*
create a poll_event_context structure.
*/
@@ -72,22 +88,6 @@ static int poll_event_context_init(struct tevent_context *ev)
return 0;
}
-static int poll_event_mt_destructor(struct poll_event_context *poll_ev)
-{
- if (poll_ev->signal_fd != -1) {
- close(poll_ev->signal_fd);
- poll_ev->signal_fd = -1;
- }
- if (poll_ev->num_fds == 0) {
- return 0;
- }
- if (poll_ev->fds[0].fd != -1) {
- close(poll_ev->fds[0].fd);
- poll_ev->fds[0].fd = -1;
- }
- return 0;
-}
-
static bool set_nonblock(int fd)
{
int val;