summaryrefslogtreecommitdiff
path: root/nuttx/lib/unistd/lib_getcwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/lib/unistd/lib_getcwd.c')
-rw-r--r--nuttx/lib/unistd/lib_getcwd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/lib/unistd/lib_getcwd.c b/nuttx/lib/unistd/lib_getcwd.c
index 6888470ac..9bfa102fb 100644
--- a/nuttx/lib/unistd/lib_getcwd.c
+++ b/nuttx/lib/unistd/lib_getcwd.c
@@ -99,11 +99,13 @@ FAR char *getcwd(FAR char *buf, size_t size)
/* Verify input parameters */
+#ifdef CONFIG_DEBUG
if (!buf || !size)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return NULL;
}
+#endif
/* If no working directory is defined, then default to the home directory */
@@ -117,7 +119,7 @@ FAR char *getcwd(FAR char *buf, size_t size)
if (strlen(pwd) + 1 > size)
{
- errno = ERANGE;
+ set_errno(ERANGE);
return NULL;
}