FLTK logo

Re: [fltk/fltk] scandir_posix.c readentry should check for ENOENT (#238)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] scandir_posix.c readentry should check for ENOENT (#238) Albrecht Schlosser Jun 16, 2021  
 

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 are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.