sched/taskspawn: fix spawn fail if enable FDCHECK

protect file descriptor before compare

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-11-22 17:04:43 +08:00 committed by Alin Jerpelea
parent 817e02c0c8
commit 59cf308eff

View File

@ -507,6 +507,9 @@ int files_duplist(FAR struct filelist *plist, FAR struct filelist *clist,
if (actions != NULL)
{
#ifdef CONFIG_FDCHECK
fd = fdcheck_protect(fd);
#endif
if (!spawn_file_is_duplicateable(actions, fd, fcloexec))
{
continue;