Changeset 427 for vendor/current/lib/tevent
- Timestamp:
- Apr 9, 2010, 3:20:58 PM (15 years ago)
- Location:
- vendor/current/lib/tevent
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/tevent/tevent.c
r414 r427 177 177 se->event_ctx = NULL; 178 178 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); 179 186 } 180 187 -
vendor/current/lib/tevent/tevent_internal.h
r414 r427 300 300 const char *location); 301 301 int tevent_common_check_signal(struct tevent_context *ev); 302 void tevent_cleanup_pending_signal_handlers(struct tevent_signal *se); 302 303 303 304 bool tevent_standard_init(void); -
vendor/current/lib/tevent/tevent_signal.c
r414 r427 134 134 static int tevent_common_signal_list_destructor(struct tevent_common_signal_list *sl) 135 135 { 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 } 137 139 return 0; 138 140 } … … 155 157 if (sig_state->sig_handlers[se->signum] == NULL) { 156 158 /* 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 } 159 163 #ifdef SA_SIGINFO 160 164 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 } 163 169 } 164 170 #endif … … 399 405 return 1; 400 406 } 407 408 void 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 }
Note:
See TracChangeset
for help on using the changeset viewer.