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:
Zeng Zhaoxiu
2021-12-29 20:02:09 +08:00
committed by Masayuki Ishikawa
parent 9aa69168e4
commit fb43fd73ed
26 changed files with 13 additions and 221 deletions
-11
View File
@@ -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;