From 5db4d2a83baafbd97716cbe392b3ceebe37aff6a Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:42:12 +0900 Subject: [PATCH] sched/task: Fix wrong return value from nxspawn_open() nxspawn_open() is expected to return "OK" when it success, but it doesn't return it in case of executing dup2. Because of this, the "Command as parameter" couldn't work with Builtin Apps. --- sched/task/task_spawnparms.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index eb2e44f745..b5ee997c48 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -128,6 +128,10 @@ static inline int nxspawn_open(FAR struct spawn_open_file_action_s *action) { serr("ERROR: dup2 failed: %d\n", ret); } + else + { + ret = OK; + } sinfo("Closing fd=%d\n", fd); nx_close(fd);