mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
signal: signal handler may cause task's state error
For example, task is blocked by nxsem_wait(sem1), use nxsem_wait(sem2) in signal handler, and take sem2 successfully, after exit from signal handler to task, nxsem_wait(sem1) returns OK, but the correct result should be -EINTR. Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
9aa69168e4
commit
fb43fd73ed
@@ -56,13 +56,6 @@ void up_sigdeliver(void)
|
||||
struct tcb_s *rtcb = this_task();
|
||||
uint8_t regs[XCPTCONTEXT_SIZE];
|
||||
|
||||
/* Save the errno. This must be preserved throughout the signal handling
|
||||
* so that the user code final gets the correct errno value (probably
|
||||
* EINTR).
|
||||
*/
|
||||
|
||||
int saved_errno = get_errno();
|
||||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
@@ -92,7 +85,6 @@ void up_sigdeliver(void)
|
||||
|
||||
sinfo("Resuming\n");
|
||||
up_irq_save();
|
||||
set_errno(saved_errno);
|
||||
|
||||
/* Modify the saved return state with the actual saved values in the
|
||||
* TCB. This depends on the fact that nested signal handling is
|
||||
|
||||
@@ -57,13 +57,6 @@ void up_sigdeliver(void)
|
||||
uint32_t regs[XCPTCONTEXT_REGS];
|
||||
sig_deliver_t sigdeliver;
|
||||
|
||||
/* Save the errno. This must be preserved throughout the signal handling
|
||||
* so that the user code final gets the correct errno value (probably
|
||||
* EINTR).
|
||||
*/
|
||||
|
||||
int saved_errno = get_errno();
|
||||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
@@ -104,7 +97,6 @@ void up_sigdeliver(void)
|
||||
|
||||
sinfo("Resuming\n");
|
||||
up_irq_save();
|
||||
set_errno(saved_errno);
|
||||
|
||||
/* Then restore the correct state for this thread of
|
||||
* execution.
|
||||
|
||||
@@ -56,13 +56,6 @@ void up_sigdeliver(void)
|
||||
struct tcb_s *rtcb = this_task();
|
||||
uint32_t regs[XCPTCONTEXT_REGS];
|
||||
|
||||
/* Save the errno. This must be preserved throughout the signal handling
|
||||
* so that the user code final gets the correct errno value (probably
|
||||
* EINTR).
|
||||
*/
|
||||
|
||||
int saved_errno = get_errno();
|
||||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
@@ -92,7 +85,6 @@ void up_sigdeliver(void)
|
||||
|
||||
sinfo("Resuming\n");
|
||||
up_irq_save();
|
||||
set_errno(saved_errno);
|
||||
|
||||
/* Modify the saved return state with the actual saved values in the
|
||||
* TCB. This depends on the fact that nested signal handling is
|
||||
|
||||
Reference in New Issue
Block a user