pkgsrc-Users archive

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

should be fixed: gmake[3]: *** readdir .: Invalid argument. Stop.



hi folks.


i just spent a bit of time looking at this and it turns out to be a
gmake bug.  it assumes that if readdir() returns NULL, it will set
errno to indicate the error.  however, it is not supposed to change
errno for the end of directory condition.  from:

   https://pubs.opengroup.org/onlinepubs/9799919799/

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.
                                 ^^^^^^^^^^^^^^^^^^^^

i commited a fix to set "errno = 0" before this readdir call, which
should fix the code here.  please let us (me, gnats, this list)
know if you see this failure with gmake 4.4.1nb1, as that will mean
my fix is not a fix.  being a fairly rare issue, it will be a few
months until i'm fully confident but i'm 90% sure at this point.


.mrg.


Home | Main Index | Thread Index | Old Index