diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-07-01 12:02:00 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-07-01 12:02:00 +0400 |
commit | f3ccf5061fdf7110be6e6f1dd98fe696842081d1 (patch) | |
tree | efbce8aad056787a82089f5e73940248c0a2c3a0 /mysys/thr_alarm.c | |
parent | b36a02822430ce90285f067f8e6e8d87859732aa (diff) | |
download | mariadb-git-f3ccf5061fdf7110be6e6f1dd98fe696842081d1.tar.gz |
Bug#54667: Unnecessary signal handler redefinition
POSIX requires that a signal handler defined with sigaction()
is not reset on delivering a signal unless SA_NODEFER or
SA_RESETHAND is set. It is therefore unnecessary to redefine
the handler on signal delivery on platforms where sigaction()
is used without those flags.
include/my_alarm.h:
Renamed DONT_REMEMBER_SIGNAL ->
SIGNAL_HANDLER_RESET_ON_DELIVERY.
include/my_global.h:
Renamed DONT_REMEMBER_SIGNAL ->
SIGNAL_HANDLER_RESET_ON_DELIVERY. The latter is now defined
only on non-BSD platforms missing the POSIX sigaction()
function.
libmysql/libmysql.c:
Renamed DONT_REMEMBER_SIGNAL ->
SIGNAL_HANDLER_RESET_ON_DELIVERY
mysys/thr_alarm.c:
Renamed DONT_REMEMBER_SIGNAL ->
SIGNAL_HANDLER_RESET_ON_DELIVERY
sql/mysqld.cc:
Renamed DONT_REMEMBER_SIGNAL ->
SIGNAL_HANDLER_RESET_ON_DELIVERY
Diffstat (limited to 'mysys/thr_alarm.c')
-rw-r--r-- | mysys/thr_alarm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index b710a7eee39..386691be4de 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -306,7 +306,7 @@ sig_handler process_alarm(int sig __attribute__((unused))) #if defined(MAIN) && !defined(__bsdi__) printf("thread_alarm in process_alarm\n"); fflush(stdout); #endif -#ifdef DONT_REMEMBER_SIGNAL +#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ #endif return; @@ -325,7 +325,7 @@ sig_handler process_alarm(int sig __attribute__((unused))) #endif process_alarm_part2(sig); #ifndef USE_ALARM_THREAD -#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) +#if defined(SIGNAL_HANDLER_RESET_ON_DELIVERY) && !defined(USE_ONE_SIGNAL_HAND) my_sigset(THR_SERVER_ALARM,process_alarm); #endif pthread_mutex_unlock(&LOCK_alarm); @@ -523,12 +523,12 @@ void thr_alarm_info(ALARM_INFO *info) */ -static sig_handler thread_alarm(int sig) +static sig_handler thread_alarm(int sig __attribute__((unused))) { #ifdef MAIN printf("thread_alarm\n"); fflush(stdout); #endif -#ifdef DONT_REMEMBER_SIGNAL +#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY my_sigset(sig,thread_alarm); /* int. thread system calls */ #endif } @@ -797,7 +797,7 @@ static sig_handler print_signal_warning(int sig) { printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); fflush(stdout); -#ifdef DONT_REMEMBER_SIGNAL +#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY my_sigset(sig,print_signal_warning); /* int. thread system calls */ #endif if (sig == SIGALRM) |