From aed85964ffe2ad81e7b8cfee60cf6f0c302bc347 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 16 Oct 2022 21:24:29 +0800 Subject: [PATCH] sched/env: Don't need copy env variable from parent in env_dup since caller always pass them if needed Signed-off-by: Xiang Xiao --- sched/environ/env_dup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c index 6070cc462c..9795666d07 100644 --- a/sched/environ/env_dup.c +++ b/sched/environ/env_dup.c @@ -63,7 +63,6 @@ int env_dup(FAR struct task_group_s *group, FAR char * const *envcp) { - FAR struct tcb_s *ptcb = this_task(); FAR char **envp = NULL; size_t envc = 0; int ret = OK; @@ -78,7 +77,7 @@ int env_dup(FAR struct task_group_s *group, FAR char * const *envcp) /* Is there an environment ? */ - if (envcp || (envcp = ptcb->group->tg_envp) != NULL) + if (envcp != NULL) { /* Count the strings */