aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2012-09-18 13:03:00 +0000
committerEd Maste <emaste@FreeBSD.org>2012-09-18 13:03:00 +0000
commit3aa37f13ad4823de324bb170dbd11ce9cc46bc66 (patch)
tree221f1bef89c5b0b5345d31a9f727006757d43468
parent0f5cc5c69aa3125e2232c4dc3827a01194ac58e7 (diff)
downloadsrc-3aa37f13ad4823de324bb170dbd11ce9cc46bc66.tar.gz
src-3aa37f13ad4823de324bb170dbd11ce9cc46bc66.zip
MFC r240410:
Avoid mapping ENOENT to ENOTDIR for non-existent path components. The ENOTDIR mapping was introduced in r235266 for kern/128933 based on an interpretation of the somewhat ambiguous language in the POSIX realpath specification. The interpretation is inconsistent with Solaris and Linux, a regression from 9.0, and does not appear to be permitted by the description of ENOTDIR: 20 ENOTDIR Not a directory. A component of the specified pathname existed, but it was not a directory, when a directory was expected. PR: standards/171577 Approved by: re Sponsored by: ADARA Networks
Notes
Notes: svn path=/releng/9.1/; revision=240647
-rw-r--r--lib/libc/stdlib/realpath.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index aded9b244e78..8fd5457af9c3 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -181,8 +181,6 @@ realpath(const char * __restrict path, char * __restrict resolved)
return (NULL);
}
if (lstat(resolved, &sb) != 0) {
- if (errno != ENOENT || p != NULL)
- errno = ENOTDIR;
if (m)
free(resolved);
return (NULL);