From e50d1211df09a6b96568d2ac1915a06fb90ca07a Mon Sep 17 00:00:00 2001 From: zhangyuan21 Date: Fri, 28 Jul 2023 16:10:40 +0800 Subject: [PATCH] task_spawnparms: out of loop when ret less than 0 The nxspawn_dup2 function will return a value greater than 0, so the loop should only exit if ret is less than 0. Signed-off-by: zhangyuan21 --- sched/task/task_spawnparms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index 2813713534..c3198def2e 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -274,7 +274,7 @@ int spawn_file_actions(FAR struct tcb_s *tcb, /* Execute each file action */ for (entry = (FAR struct spawn_general_file_action_s *)actions; - entry && ret == OK; + entry && ret >= 0; entry = entry->flink) { switch (entry->action)