mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
nshlib/builtin: check background task before restore the signal
fix crash if: CONFIG_SCHED_WAITPID=n CONFIG_SCHED_CHILD_STATUS=y The old signal will be restored only when sigaction is saved to avoid invaild access. Signed-off-by: chao an <anchao.archer@bytedance.com>
This commit is contained in:
parent
fb0c1e10de
commit
7f424c3e8d
1 changed files with 7 additions and 1 deletions
|
|
@ -234,7 +234,13 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
|||
|
||||
/* Restore the old actions */
|
||||
|
||||
sigaction(SIGCHLD, &old, NULL);
|
||||
# ifndef CONFIG_SCHED_WAITPID
|
||||
if (vtbl->np.np_bg == true)
|
||||
# endif
|
||||
{
|
||||
sigaction(SIGCHLD, &old, NULL);
|
||||
}
|
||||
|
||||
# endif
|
||||
struct sched_param sched;
|
||||
sched_getparam(ret, &sched);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue