mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
minor cleanups, and only have one thread responding to TERM
svn path=/trunk/avl/; revision=5787
This commit is contained in:
parent
e15c02cbec
commit
a3b60b2713
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $Id: avl.c,v 1.10 2003/12/04 16:27:30 oddsock Exp $ */
|
||||
/* $Id: avl.c,v 1.11 2004/01/27 02:16:25 karl Exp $ */
|
||||
|
||||
/*
|
||||
* This is a fairly straightfoward translation of a prototype
|
||||
@ -89,7 +89,8 @@ avl_tree_free_helper (avl_node * node, avl_free_key_fun_type free_key_fun)
|
||||
if (node->left) {
|
||||
avl_tree_free_helper (node->left, free_key_fun);
|
||||
}
|
||||
free_key_fun (node->key);
|
||||
if (free_key_fun)
|
||||
free_key_fun (node->key);
|
||||
if (node->right) {
|
||||
avl_tree_free_helper (node->right, free_key_fun);
|
||||
}
|
||||
@ -446,7 +447,8 @@ int avl_delete(avl_tree *tree, void *key, avl_free_key_fun_type free_key_fun)
|
||||
p = x->parent;
|
||||
|
||||
/* return the key and node to storage */
|
||||
free_key_fun (x->key);
|
||||
if (free_key_fun)
|
||||
free_key_fun (x->key);
|
||||
thread_rwlock_destroy (&x->rwlock);
|
||||
free (x);
|
||||
|
||||
|
@ -222,7 +222,6 @@ static void _block_signals(void)
|
||||
/* These ones we want */
|
||||
sigdelset(&ss, SIGKILL);
|
||||
sigdelset(&ss, SIGSTOP);
|
||||
sigdelset(&ss, SIGTERM);
|
||||
sigdelset(&ss, SIGSEGV);
|
||||
sigdelset(&ss, SIGBUS);
|
||||
if (pthread_sigmask(SIG_BLOCK, &ss, NULL) != 0) {
|
||||
@ -250,6 +249,7 @@ static void _catch_signals(void)
|
||||
sigaddset(&ss, SIGCHLD);
|
||||
sigaddset(&ss, SIGINT);
|
||||
sigaddset(&ss, SIGPIPE);
|
||||
sigaddset(&ss, SIGTERM);
|
||||
|
||||
if (pthread_sigmask(SIG_UNBLOCK, &ss, NULL) != 0) {
|
||||
#ifdef THREAD_DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user