From 59cf308eff8a307fc8f675e49a6e3b5c4a6a50c0 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 22 Nov 2023 17:04:43 +0800 Subject: [PATCH] sched/taskspawn: fix spawn fail if enable FDCHECK protect file descriptor before compare Signed-off-by: chao an --- fs/inode/fs_files.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index 8729f48e19b..93ee0377854 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -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;