Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/tevent/tevent.c

    r740 r988  
    113113static void tevent_backend_init(void)
    114114{
     115        static bool done;
     116
     117        if (done) {
     118                return;
     119        }
     120
     121        done = true;
     122
    115123        tevent_select_init();
    116124        tevent_poll_init();
     125        tevent_poll_mt_init();
     126#if defined(HAVE_EPOLL)
     127        tevent_epoll_init();
     128#elif defined(HAVE_SOLARIS_PORTS)
     129        tevent_port_init();
     130#endif
     131
    117132        tevent_standard_init();
    118 #ifdef HAVE_EPOLL
    119         tevent_epoll_init();
    120 #endif
     133}
     134
     135_PRIVATE_ const struct tevent_ops *tevent_find_ops_byname(const char *name)
     136{
     137        struct tevent_ops_list *e;
     138
     139        tevent_backend_init();
     140
     141        if (name == NULL) {
     142                name = tevent_default_backend;
     143        }
     144        if (name == NULL) {
     145                name = "standard";
     146        }
     147
     148        for (e = tevent_backends; e != NULL; e = e->next) {
     149                if (0 == strcmp(e->name, name)) {
     150                        return e->ops;
     151                }
     152        }
     153
     154        return NULL;
    121155}
    122156
     
    160194        }
    161195
     196        ev->last_zero_timer = NULL;
    162197        for (te = ev->timer_events; te; te = tn) {
    163198                tn = te->next;
     
    186221        }
    187222
     223        /* removing nesting hook or we get an abort when nesting is
     224         * not allowed. -- SSS
     225         * Note that we need to leave the allowed flag at its current
     226         * value, otherwise the use in tevent_re_initialise() will
     227         * leave the event context with allowed forced to false, which
     228         * will break users that expect nesting to be allowed
     229         */
     230        ev->nesting.level = 0;
     231        ev->nesting.hook_fn = NULL;
     232        ev->nesting.hook_private = NULL;
     233
    188234        return 0;
    189235}
     
    200246  NOTE: use tevent_context_init() inside of samba!
    201247*/
    202 static struct tevent_context *tevent_context_init_ops(TALLOC_CTX *mem_ctx,
    203                                                       const struct tevent_ops *ops)
     248struct tevent_context *tevent_context_init_ops(TALLOC_CTX *mem_ctx,
     249                                               const struct tevent_ops *ops,
     250                                               void *additional_data)
    204251{
    205252        struct tevent_context *ev;
     
    212259
    213260        ev->ops = ops;
     261        ev->additional_data = additional_data;
    214262
    215263        ret = ev->ops->context_init(ev);
     
    230278                                                  const char *name)
    231279{
    232         struct tevent_ops_list *e;
    233 
    234         tevent_backend_init();
    235 
    236         if (name == NULL) {
    237                 name = tevent_default_backend;
    238         }
    239         if (name == NULL) {
    240                 name = "standard";
    241         }
    242 
    243         for (e=tevent_backends;e;e=e->next) {
    244                 if (strcmp(name, e->name) == 0) {
    245                         return tevent_context_init_ops(mem_ctx, e->ops);
    246                 }
    247         }
    248         return NULL;
     280        const struct tevent_ops *ops;
     281
     282        ops = tevent_find_ops_byname(name);
     283        if (ops == NULL) {
     284                return NULL;
     285        }
     286
     287        return tevent_context_init_ops(mem_ctx, ops, NULL);
    249288}
    250289
     
    392431/*
    393432  schedule an immediate event
    394   return NULL on failure
    395433*/
    396434void _tevent_schedule_immediate(struct tevent_immediate *im,
     
    492530        }
    493531
     532        tevent_trace_point_callback(ev, TEVENT_TRACE_BEFORE_LOOP_ONCE);
    494533        ret = ev->ops->loop_once(ev, location);
     534        tevent_trace_point_callback(ev, TEVENT_TRACE_AFTER_LOOP_ONCE);
    495535
    496536        if (ev->nesting.level > 0) {
     
    552592
    553593        while (!finished(private_data)) {
     594                tevent_trace_point_callback(ev, TEVENT_TRACE_BEFORE_LOOP_ONCE);
    554595                ret = ev->ops->loop_once(ev, location);
     596                tevent_trace_point_callback(ev, TEVENT_TRACE_AFTER_LOOP_ONCE);
    555597                if (ret != 0) {
    556598                        break;
Note: See TracChangeset for help on using the changeset viewer.