[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test failure on FreeBSD (permissible errno values)

From: Eric Blake
Subject: Re: Test failure on FreeBSD (permissible errno values)
Date: Wed, 12 Sep 2012 08:44:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/12/2012 08:38 AM, Paul Eggert wrote:
> On 09/12/2012 06:38 AM, Ed Maste wrote:
>> Should ENOTDIR be a permissible errno for this test?
> I don't see why.  It's not called out in the GNU documentation
> for canonicalize_file_name, and the POSIX documentation for
> realpath does not seem to allow ENOTDIR for the similar
> situation with realpath.  Why is the code returning ENOTDIR
> here?

The POSIX wording is:

[ENOENT] A component of file_name does not name an existing file or
file_name points to
              an empty string.
[ENOTDIR] A component of the path prefix is not a directory, or the
file_name argument
         contains at least one non-<slash> character and ends with one
or more trailing
        <slash> characters and the last pathname component names an
existing file
       that is neither a directory nor a symbolic link to a directory.

Since '/path/to/zzz' does not exist, this should be ENOENT; ENOTDIR
would only be valid in the case where /path/to/zzz exists but is not a
directory.  It sounds like a bug in the FreeBSD kernel.

That said, are we already replacing realpath() on FreeBSD?  If so, then
we should fix our replacement; if not, then I'm probably okay with
relaxing the test to allow the alternate error code.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]