summaryrefslogtreecommitdiff
path: root/nuttx/sched/env_release.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/env_release.c')
-rw-r--r--nuttx/sched/env_release.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/nuttx/sched/env_release.c b/nuttx/sched/env_release.c
index d124477d5..83e65dbb5 100644
--- a/nuttx/sched/env_release.c
+++ b/nuttx/sched/env_release.c
@@ -2,7 +2,7 @@
* sched/env_clearenv.c
*
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -55,12 +55,12 @@
****************************************************************************/
/****************************************************************************
- * Function: env_release
+ * Name: env_release
*
* Description:
- * The env_release() function clears the environment of all name-value pairs
- * and sets the value of the external variable environ to NULL.
-
+ * The env_release() function clears the environment of all name-value
+ * pairs and sets the value of the external variable environ to NULL.
+ *
* Parameters:
* ptcb Identifies the TCB containing the environment structure
*
@@ -75,6 +75,7 @@
int env_release(FAR _TCB *ptcb)
{
int ret = OK;
+
if (!ptcb)
{
ret = -EINVAL;
@@ -111,8 +112,10 @@ int env_release(FAR _TCB *ptcb)
ptcb->envp = NULL;
}
+
sched_unlock();
}
+
return ret;
}