You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Lucian Adrian Grijincu <lu...@gmail.com> on 2007/10/28 13:27:01 UTC

ENOENT / ENODIR in apr_stat - wrong comment or code

in file_io/unix/filestat.c there this code block:


        /* WARNING: All errors but not found will be handled as not directory
         */
        if (errno != ENOENT)
            return APR_ENOENT;
        else
            return errno;

http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filestat.c?view=markup


Either the code is wrong or the comment (or, of course, my interpretation).

Should it be (and respect the comment):

        /* WARNING: All errors but not found will be handled as not directory
         */
        if (errno != ENOENT)
            return APR_ENODIR;
        else
            return errno;

or just this (it has the same functionality):

        return errno;
--
Lucian

Re: ENOENT / ENODIR in apr_stat - wrong comment or code

Posted by Lucian Adrian Grijincu <lu...@gmail.com>.
On 10/28/07, Lucian Adrian Grijincu <lu...@gmail.com> wrote:
> in file_io/unix/filestat.c there this code block:
>
>
>         /* WARNING: All errors but not found will be handled as not directory
>          */
>         if (errno != ENOENT)
>             return APR_ENOENT;
>         else
>             return errno;
>
> http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filestat.c?view=markup
>
>
> Either the code is wrong or the comment (or, of course, my interpretation).
>
> Should it be (and respect the comment):
>
>         /* WARNING: All errors but not found will be handled as not directory
>          */
>         if (errno != ENOENT)
>             return APR_ENODIR;
>         else
>             return errno;
>
> or just this (it has the same functionality):
>

sorry, I meant:
        return APR_ENOENT;

> --
> Lucian
>