mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
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
MFC after: 3 days
This commit is contained in:
parent
b5bec59148
commit
7877ed7ce3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240410
1 changed files with 0 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue