Skip to content

Commit

Permalink
platforms/nuttx/src/px4/common/tasks.cpp: Fix exec_builtin call accor…
Browse files Browse the repository at this point in the history
…ding to the new NuttX

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Dec 9, 2024
1 parent 7b2871b commit 9f715c8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion platforms/nuttx/src/px4/common/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <stdbool.h>
#include <spawn.h>
#include <libgen.h>
#include <fcntl.h>

#include <builtin/builtin.h>

Expand Down Expand Up @@ -100,7 +101,15 @@ const char *px4_get_taskname(void)
int px4_exec(const char *appname, char *const *argv, const char *redirfile, int oflags)
{
#ifdef CONFIG_BUILTIN
return exec_builtin(appname, argv, NULL, redirfile, oflags);
const struct nsh_param_s param = {
.fd_in = -1,
.fd_out = -1,
.oflags_in = O_RDONLY,
.oflags_out = oflags,
.file_in = NULL,
.file_out = redirfile,
};
return exec_builtin(appname, argv, &param);
#else
char path[CONFIG_PATH_MAX];
posix_spawn_file_actions_t file_actions;
Expand Down

0 comments on commit 9f715c8

Please sign in to comment.