mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
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>
This commit is contained in:
parent
d944e2cae1
commit
e3309852f7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user