[MPlayer-dev-eng] Re: [PATCH] osd menu fielsel.c

Gábor Lénárt lgb at lgb.hu
Thu Nov 21 11:47:01 CET 2002


On Thu, Nov 21, 2002 at 09:17:06PM +1100, Daniel Pittman wrote:
> On Thu, 21 Nov 2002, BjXrn Sandell wrote:
> > On Thu, 21 Nov 2002 07:23:02 +0100
> > Alban Bedel <albeu at free.fr> wrote:
> >> Hi Björn Sandell,
> >> on Tue, 19 Nov 2002 18:59:09 +0100 you wrote:
> >> > A patch to make menu_filesel.c a bit more portable. Tested on
> >> > RedHat and OpenBSD.
> 
> [...]
> 
> >> And what is the use of this d_type thing instead of stat ?
> > 
> > Well, it seems unnessecary to do stat() to figure out something you
> > already know, and it makes it much easier to move the definition of
> > compare() out of oper_dir().
> 
> It looks to me like you trust the content of the d_type field when it's
> present. On Linux this field can be present but set to unknown if an
> early enough kernel is in use or the filesystem does not fill the value.

Yes, for readdir():

man readdir
[...]
BUGS
       Field d_type is not implemented as of libc6 2.1 and will always  return
       DT_UNKNOWN (0).

You should stat the file to get this information, AFAIK ...

- Gábor (larta'H)



More information about the MPlayer-dev-eng mailing list