]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
s/fr_event_list_create/fr_event_list_init/
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 8 Nov 2016 17:11:50 +0000 (12:11 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 8 Nov 2016 17:11:50 +0000 (12:11 -0500)
src/include/event.h
src/lib/event.c
src/main/process.c
src/main/radsniff.c
src/main/threads.c
src/modules/proto_bfd/proto_bfd.c

index 3140c0029b2943ce103c72c22462ce7f443a354a..4a4c5bc67a1df6e1ebde4d736c488a5e6095e727 100644 (file)
@@ -37,7 +37,7 @@ typedef       void (*fr_event_callback_t)(void *, struct timeval *now);
 typedef        void (*fr_event_status_t)(struct timeval *);
 typedef void (*fr_event_fd_handler_t)(fr_event_list_t *el, int sock, void *ctx);
 
-fr_event_list_t *fr_event_list_create(TALLOC_CTX *ctx, fr_event_status_t status);
+fr_event_list_t *fr_event_list_init(TALLOC_CTX *ctx, fr_event_status_t status);
 
 int fr_event_list_num_fds(fr_event_list_t *el);
 int fr_event_list_num_elements(fr_event_list_t *el);
index 12de052107ce70d248935147f3892ce8b74d681f..70b6e50c7ae860388819ef2289311a28ab105253 100644 (file)
@@ -85,6 +85,16 @@ static int fr_event_list_time_cmp(void const *one, void const *two)
        return 0;
 }
 
+static int fr_event_fd_cmp(void const *a, void const *b)
+{
+       fr_event_fd_t const *efd_a = a;
+       fr_event_fd_t const *efd_b = b;
+
+       if (efd_a->fd > efd_b->fd) return +1;
+       if (efd_a->fd < efd_b->fd) return -1;
+
+       return 0;
+}
 
 static int _event_list_free(fr_event_list_t *list)
 {
@@ -103,7 +113,7 @@ static int _event_list_free(fr_event_list_t *list)
 }
 
 
-fr_event_list_t *fr_event_list_create(TALLOC_CTX *ctx, fr_event_status_t status)
+fr_event_list_t *fr_event_list_init(TALLOC_CTX *ctx, fr_event_status_t status)
 {
        int i;
        fr_event_list_t *el;
@@ -633,7 +643,7 @@ int main(int argc, char **argv)
        struct timeval now, when;
        fr_event_list_t *el;
 
-       el = fr_event_list_create(NULL, NULL);
+       el = fr_event_list_init(NULL, NULL);
        if (!el) exit(1);
 
        memset(&rand_pool, 0, sizeof(rand_pool));
index 04481563ecee5e71a02d024fc7380f8bfc89cca0..a06883706e3f7796cf723a8a08220397352d3950 100644 (file)
@@ -5182,7 +5182,7 @@ static void event_signal_handler(UNUSED fr_event_list_t *xel,
  *     Externally-visibly functions.
  */
 int radius_event_init(TALLOC_CTX *ctx) {
-       el = fr_event_list_create(ctx, event_status);
+       el = fr_event_list_init(ctx, event_status);
        if (!el) return 0;
 
 #ifdef HAVE_SYSTEMD_WATCHDOG
index 0ccf9cc39b7de90b6fb3f868c838c26f7b0e23b0..f3616fb75b7b2c020bb5edd463029585906affd8 100644 (file)
@@ -2786,7 +2786,7 @@ int main(int argc, char *argv[])
 
                char *buff;
 
-               events = fr_event_list_create(conf, _rs_event_status);
+               events = fr_event_list_init(conf, _rs_event_status);
                if (!events) {
                        ERROR();
                        goto finish;
index 8296a879b3867565b2f4bcb91122ef133564f2e4..a05db68ed1767d9c271cab32cffb362d9926cf4e 100644 (file)
@@ -455,7 +455,7 @@ static void *thread_handler(void *arg)
 
        ctx = talloc_init("thread_pool");
 
-       el = fr_event_list_create(ctx, NULL);
+       el = fr_event_list_init(ctx, NULL);
        rad_assert(el != NULL);
 
        local_backlog = fr_heap_create(timestamp_cmp, offsetof(REQUEST, heap_id));
index 5e870668cdf9b3731033d8cc03302b03300ef5cc..cb3202d78c641a8fe9c6dbae13074a78de7abe5d 100644 (file)
@@ -317,7 +317,7 @@ static int bfd_pthread_create(bfd_state_t *session)
                return 0;
        }
 
-       session->el = fr_event_list_create(session, NULL);
+       session->el = fr_event_list_init(session, NULL);
        if (!session->el) {
                ERROR("Failed creating event list");
        close_pipes: