Changeset 427 for vendor/current/lib


Ignore:
Timestamp:
Apr 9, 2010, 3:20:58 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5.x: update to 3.5.2

Location:
vendor/current/lib
Files:
6 edited

Legend:

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

    r414 r427  
    177177                se->event_ctx = NULL;
    178178                DLIST_REMOVE(ev->signal_events, se);
     179                /*
     180                 * This is important, Otherwise signals
     181                 * are handled twice in child. eg, SIGHUP.
     182                 * one added in parent, and another one in
     183                 * the child. -- BoYang
     184                 */
     185                tevent_cleanup_pending_signal_handlers(se);
    179186        }
    180187
  • vendor/current/lib/tevent/tevent_internal.h

    r414 r427  
    300300                                               const char *location);
    301301int tevent_common_check_signal(struct tevent_context *ev);
     302void tevent_cleanup_pending_signal_handlers(struct tevent_signal *se);
    302303
    303304bool tevent_standard_init(void);
  • vendor/current/lib/tevent/tevent_signal.c

    r414 r427  
    134134static int tevent_common_signal_list_destructor(struct tevent_common_signal_list *sl)
    135135{
    136         DLIST_REMOVE(sig_state->sig_handlers[sl->se->signum], sl);
     136        if (sig_state->sig_handlers[sl->se->signum]) {
     137                DLIST_REMOVE(sig_state->sig_handlers[sl->se->signum], sl);
     138        }
    137139        return 0;
    138140}
     
    155157        if (sig_state->sig_handlers[se->signum] == NULL) {
    156158                /* restore old handler, if any */
    157                 sigaction(se->signum, sig_state->oldact[se->signum], NULL);
    158                 sig_state->oldact[se->signum] = NULL;
     159                if (sig_state->oldact[se->signum]) {
     160                        sigaction(se->signum, sig_state->oldact[se->signum], NULL);
     161                        sig_state->oldact[se->signum] = NULL;
     162                }
    159163#ifdef SA_SIGINFO
    160164                if (se->sa_flags & SA_SIGINFO) {
    161                         talloc_free(sig_state->sig_info[se->signum]);
    162                         sig_state->sig_info[se->signum] = NULL;
     165                        if (sig_state->sig_info[se->signum]) {
     166                                talloc_free(sig_state->sig_info[se->signum]);
     167                                sig_state->sig_info[se->signum] = NULL;
     168                        }
    163169                }
    164170#endif
     
    399405        return 1;
    400406}
     407
     408void tevent_cleanup_pending_signal_handlers(struct tevent_signal *se)
     409{
     410        struct tevent_common_signal_list *sl;
     411        sl = talloc_get_type(se->additional_data,
     412                             struct tevent_common_signal_list);
     413
     414        tevent_common_signal_list_destructor(sl);
     415
     416        if (sig_state->sig_handlers[se->signum] == NULL) {
     417                if (sig_state->oldact[se->signum]) {
     418                        sigaction(se->signum, sig_state->oldact[se->signum], NULL);
     419                        sig_state->oldact[se->signum] = NULL;
     420                }
     421        }
     422        return;
     423}
  • vendor/current/lib/util/talloc_stack.c

    r414 r427  
    104104                }
    105105                talloc_free(ts->talloc_stack[i]);
     106                ts->talloc_stack[i] = NULL;
    106107        }
    107108
     109        ts->talloc_stack[i] = NULL;
    108110        ts->talloc_stacksize = i;
    109111        return 0;
     
    182184                (struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
    183185
    184         if (ts == NULL) {
     186        if (ts == NULL || ts->talloc_stacksize == 0) {
    185187                talloc_stackframe();
    186188                ts = (struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
  • vendor/current/lib/util/util_tdb.c

    r414 r427  
    3939}
    4040
     41bool tdb_data_equal(TDB_DATA t1, TDB_DATA t2)
     42{
     43        if (t1.dsize != t2.dsize) {
     44                return false;
     45        }
     46        return (memcmp(t1.dptr, t2.dptr, t1.dsize) == 0);
     47}
     48
    4149TDB_DATA string_tdb_data(const char *string)
    4250{
  • vendor/current/lib/util/util_tdb.h

    r414 r427  
    77****************************************************************/
    88TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize);
     9bool tdb_data_equal(TDB_DATA t1, TDB_DATA t2);
    910TDB_DATA string_tdb_data(const char *string);
    1011TDB_DATA string_term_tdb_data(const char *string);
Note: See TracChangeset for help on using the changeset viewer.