diff options
author | Volker Lendecke <vl@samba.org> | 2013-01-31 16:25:23 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-02-02 19:52:21 -0800 |
commit | e3309852f717e716181df584716aa17945326565 (patch) | |
tree | ec480269600cc75b9c7c238ba34afff54c65302d | |
parent | d944e2cae15cf1fc2e7601fecd213dec17e5132a (diff) | |
download | samba-e3309852f717e716181df584716aa17945326565.tar.gz samba-e3309852f717e716181df584716aa17945326565.tar.bz2 samba-e3309852f717e716181df584716aa17945326565.zip |
tevent_poll: Re-order routines
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | lib/tevent/tevent_poll.c | 32 |
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; |