mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
|
||||
int clearenv(void)
|
||||
{
|
||||
FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
DEBUGASSERT(tcb->group);
|
||||
|
||||
env_release(tcb->group);
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
int env_dup(FAR struct task_group_s *group)
|
||||
{
|
||||
FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
FAR struct tcb_s *ptcb = this_task();
|
||||
FAR char *envp = NULL;
|
||||
size_t envlen;
|
||||
int ret = OK;
|
||||
|
||||
@@ -94,7 +94,7 @@ FAR char *getenv(const char *name)
|
||||
/* Get a reference to the thread-private environ in the TCB. */
|
||||
|
||||
sched_lock();
|
||||
rtcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
rtcb = this_task();
|
||||
group = rtcb->group;
|
||||
|
||||
/* Check if the variable exists */
|
||||
|
||||
@@ -85,7 +85,7 @@ FAR char **get_environ_ptr(void)
|
||||
|
||||
/* Return a reference to the thread-private environ in the TCB. */
|
||||
|
||||
FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
FAR struct tcb_s *ptcb = this_task();
|
||||
if (ptcb->envp)
|
||||
{
|
||||
return &ptcb->envp->ev_env;
|
||||
|
||||
@@ -124,7 +124,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite)
|
||||
/* Get a reference to the thread-private environ in the TCB. */
|
||||
|
||||
sched_lock();
|
||||
rtcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
rtcb = this_task();
|
||||
group = rtcb->group;
|
||||
DEBUGASSERT(group);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
int unsetenv(FAR const char *name)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
FAR struct task_group_s *group = rtcb->group;
|
||||
FAR char *pvar;
|
||||
FAR char *newenvp;
|
||||
|
||||
Reference in New Issue
Block a user