Date: Mon, 7 May 2001 09:18:02 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: djgpp-workers AT delorie DOT com Subject: Re: ANNOUNCE: Fileutils 4.0 beta 2 In-Reply-To: <3AF5D99A.5CA13EFD@phekda.freeserve.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 7 May 2001, Richard Dawe wrote: > > C:\> ls a: > > c:/djgpp/bin/ls: a:: No more files (ENMFILE) > > > > `ls' from Fileutils 3.16 would simply print nothing in this case, > > which is what I'd expect. > > Are you using 2.03-compiled Fileutils 3.16? I get a similar behaviour from > 'ls' from the latest release of Fileutils 3.16 on the DJGPP archive: It's possible I used the old binaries compiled with v2.01. That was at home, so I will not be able to check until later today. > Debugging libc I see that rewinddir() calls __set_need_fake_dot_dotdot(). > __set_need_fake_dot_dotdot() calls findfirst(). On a floppy with no files > findfirst() fails, returing ENOENT. Hence __set_need_fake_dot_dotdot() > sets errno. It seems to me that it should not set errno. I think it should know about ENOENT and ENMFILE, and if that's what errno gets after findfirst, __set_need_fake_dot_dotdot should restore the previous value of errno. But if findfirst comes with some other errno, like EACCES, it should let it be. If this turns to be the solution, please put the modifed library sources into the djgpp subdirectory, and add the appropriate text to the README, so that people could build binaries without bugs. Thanks for debugging this.