Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Ticket #1630: psignalchecksignal.patch

File psignalchecksignal.patch, 1.6 KB (added by Vinu Rajashekhar, on 07/27/10 at 05:30:27)

patch which saves and restores Thread_Wait_information

  • cpukit/posix/src/psignalchecksignal.c

    diff --git a/cpukit/posix/src/psignalchecksignal.c b/cpukit/posix/src/psignalchecksignal.c
    index 516ba32..93d88e4 100644
    a b  
    1919#include <errno.h>
    2020#include <pthread.h>
    2121#include <signal.h>
     22#include <string.h>
    2223
    2324#include <rtems/system.h>
    2425#include <rtems/score/isr.h>
    bool _POSIX_signals_Check_signal( 
    4647{
    4748  siginfo_t                   siginfo_struct;
    4849  sigset_t                    saved_signals_blocked;
     50  Thread_Wait_information     stored_thread_wait_information;
    4951
    5052  if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
    5153                                       is_global, true ) )
    bool _POSIX_signals_Check_signal( 
    7375  api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
    7476
    7577  /*
     78   *  We have to save the blocking information of the current wait queue
     79   *  because the signal handler may subsequently go on and put the thread
     80   *  on a wait queue, for its own purposes.
     81   */
     82  memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
     83          sizeof( Thread_Wait_information ));
     84
     85  /*
    7686   *  Here, the signal handler function executes
    7787   */
    7888  switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
    bool _POSIX_signals_Check_signal( 
    8999  }
    90100
    91101  /*
     102   *  Restore the blocking information
     103   */
     104  memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information,
     105          sizeof( Thread_Wait_information ));
     106
     107  /*
    92108   *  Restore the previous set of blocked signals
    93109   */
    94110  api->signals_blocked = saved_signals_blocked;