mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +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
@@ -66,13 +66,6 @@ void sim_sigdeliver(void)
|
||||
irqstate_t flags = enter_critical_section();
|
||||
#endif
|
||||
|
||||
/* 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();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* In the SMP case, we must terminate the critical section while the signal
|
||||
* handler executes, but we also need to restore the irqcount when the
|
||||
@@ -134,10 +127,6 @@ void sim_sigdeliver(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Restore the saved errno value */
|
||||
|
||||
set_errno(saved_errno);
|
||||
|
||||
/* Allows next handler to be scheduled */
|
||||
|
||||
rtcb->xcp.sigdeliver = NULL;
|
||||
|
||||
Reference in New Issue
Block a user