Re: [fltk/fltk] scandir_posix.c readentry should check for ENOENT (#238)
Mark Olesen
Jun 16, 2021
It could also be a documentation problem since ENOENT statement contradicts
ERRORS paragraph?
On Wed, Jun 16, 2021 at 4:13 AM Albrecht Schlosser ***@***.***>
wrote:
> I disagree to your disagreement. In the man page you linked ENOENT is
> definitely mentioned under ERRORS:
>
> ERRORS
> The readdir() function shall fail if:
> ...
> The readdir() function may fail if:
> ...
> [ENOENT]
> The current position of the directory stream is invalid.
>
> I understand that this means an *unexpected invalid position* rather than
> a normal end of file (directory) indication. The man page also states:
>
> RETURN VALUE
> Upon successful completion, readdir() shall return a pointer to an object of
> type struct dirent. When an error is encountered, a null pointer shall be returned
> and errno shall be set to indicate the error. When the end of the directory
> is encountered, a null pointer shall be returned and errno is not changed.
>
> According to your description you receive ENOENT at the end of the
> directory which is clearly wrong, i.e. this is a bug in your libc (readdir)
> implementation.
>
> As I wrote before, if we changed this in our (FLTK) code we'd miss an
> error condition in a correct implementation of readdir(). I'm hesitating to
> do that.
>
> BTW, you wrote:
>
> DOS, OpenWatcom
>
> DOS is not a supported FLTK platform. Which kind of DOS is this (FreeDOS)?
>
> I'm also wondering what your graphics system is. The file in question is
> only compiled if USE_X11 is set. Are you using an X server as your
> display?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/fltk/fltk/issues/238#issuecomment-862233148>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AA6DEU473AXBNSKZ3PSDAX3TTB2K3ANCNFSM46WEVEKA>
> .
>
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.