diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-02 15:25:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-02 15:25:22 +0000 |
commit | 68551d0cf274eacbf5c6de959e7bf812a6ee7eba (patch) | |
tree | a26751e5f0991b18a587dbc2d37c6ee7c3ce847d /nuttx/lib/unistd | |
parent | 158978359318cb94de9e08900af4300bdfa5f651 (diff) | |
download | px4-nuttx-68551d0cf274eacbf5c6de959e7bf812a6ee7eba.tar.gz px4-nuttx-68551d0cf274eacbf5c6de959e7bf812a6ee7eba.tar.bz2 px4-nuttx-68551d0cf274eacbf5c6de959e7bf812a6ee7eba.zip |
Kernel build mostly successful
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3454 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/unistd')
-rw-r--r-- | nuttx/lib/unistd/lib_chdir.c | 2 | ||||
-rw-r--r-- | nuttx/lib/unistd/lib_getcwd.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/nuttx/lib/unistd/lib_chdir.c b/nuttx/lib/unistd/lib_chdir.c index 15dc64383..c054f2b23 100644 --- a/nuttx/lib/unistd/lib_chdir.c +++ b/nuttx/lib/unistd/lib_chdir.c @@ -173,7 +173,7 @@ int chdir(FAR const char *path) return OK; errout: - errno = err; + set_errno(err); return ERROR; } #endif /* CONFIG_NFILE_DESCRIPTORS && !CONFIG_DISABLE_ENVIRON */ 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; } |