22 |
#include <errno.h> |
#include <errno.h> |
23 |
#include <radiusd.h> |
#include <radiusd.h> |
24 |
#include <list.h> |
#include <list.h> |
25 |
|
#include <assert.h> |
26 |
|
|
27 |
struct input_system { |
struct input_system { |
28 |
LIST *methods; /* List of METHOD structures */ |
LIST *methods; /* List of METHOD structures */ |
115 |
chan->method->close(chan->fd, chan->data); |
chan->method->close(chan->fd, chan->data); |
116 |
FD_CLR(chan->fd, &chan->method->fdset); |
FD_CLR(chan->fd, &chan->method->fdset); |
117 |
chan->method->fd_max = -2; |
chan->method->fd_max = -2; |
118 |
|
efree(chan); |
119 |
} |
} |
120 |
|
|
121 |
static int |
static int |
159 |
p = iterator_next(input->citr)) { |
p = iterator_next(input->citr)) { |
160 |
list_remove(input->channels, p, NULL); |
list_remove(input->channels, p, NULL); |
161 |
channel_close(p); |
channel_close(p); |
|
efree(p); |
|
162 |
} |
} |
163 |
iterator_destroy(&input->citr); |
iterator_destroy(&input->citr); |
164 |
} |
} |
198 |
if (p) { |
if (p) { |
199 |
list_remove(input->channels, p, NULL); |
list_remove(input->channels, p, NULL); |
200 |
channel_close(p); |
channel_close(p); |
|
efree(p); |
|
201 |
} |
} |
202 |
} |
} |
203 |
|
|
206 |
{ |
{ |
207 |
METHOD *m; |
METHOD *m; |
208 |
int status; |
int status; |
209 |
|
int count = 0; |
210 |
|
|
211 |
if (!input->citr) |
if (!input->citr) |
212 |
input->citr = iterator_create(input->channels); |
input->citr = iterator_create(input->channels); |
213 |
if (!input->mitr) |
if (!input->mitr) |
231 |
if (m->fd_max < 0) |
if (m->fd_max < 0) |
232 |
continue; |
continue; |
233 |
|
|
234 |
|
count++; |
235 |
|
|
236 |
readfds = m->fdset; |
readfds = m->fdset; |
237 |
|
|
238 |
status = select(m->fd_max + 1, &readfds, NULL, NULL, tv); |
status = select(m->fd_max + 1, &readfds, NULL, NULL, tv); |
248 |
} |
} |
249 |
} |
} |
250 |
} |
} |
251 |
|
assert(count > 0); |
252 |
|
|
253 |
return status; |
return status; |
254 |
} |
} |