diff --git a/platforms/nuttx/src/px4/common/tasks.cpp b/platforms/nuttx/src/px4/common/tasks.cpp index ff22f799640a..7d3b65f84ba5 100644 --- a/platforms/nuttx/src/px4/common/tasks.cpp +++ b/platforms/nuttx/src/px4/common/tasks.cpp @@ -66,7 +66,7 @@ int px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_ { sched_lock(); -#if !defined(CONFIG_DISABLE_ENVIRON) && !defined(__KERNEL__) +#if !defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_BUILD_KERNEL) /* None of the modules access the environment variables (via getenv() for instance), so delete them * all. They are only used within the startup script, and NuttX automatically exports them to the children * tasks.