* fixed dirent handling for DragonFly BSD (patch by John Marino,

mantis #29228)

git-svn-id: trunk@32706 -
This commit is contained in:
Jonas Maebe 2015-12-24 10:54:47 +00:00
parent d866e0be32
commit f8f03ac4ad
2 changed files with 15 additions and 0 deletions

View File

@ -282,7 +282,11 @@ begin
repeat
novalid:=false;
CurEntry:=pdirent(dirp^.dd_rewind);
{$ifdef dragonfly}
RecLen:=(CurEntry^.d_namlen + 24) and $FFFFFFF8;
{$else}
RecLen:=CurEntry^.d_reclen;
{$endif}
if RecLen<>0 Then
begin {valid direntry?}
if CurEntry^.d_fileno<>0 then

View File

@ -145,6 +145,16 @@ TYPE
{ directory services }
{$ifndef darwin_new_iostructs}
{$ifdef dragonfly}
dirent = record
d_fileno : ino_t; // file number of entry
d_namlen : cuint16; // strlen (d_name)
d_type : cuint8; // file type, see below
d_unused1 : cuint8; // padding, reserved
d_unused2 : cuint32; // reserved
d_name : array[0..255] of char; // name, null terminated
end;
{$else}
dirent = record
d_fileno : cuint32; // file number of entry
d_reclen : cuint16; // length of this record
@ -152,6 +162,7 @@ TYPE
d_namlen : cuint8; // length of string in d_name
d_name : array[0..(255 + 1)-1] of char; // name must be no longer than this
end;
{$endif}
{$else not darwin_new_iostructs}
{$packrecords 4}
{ available on Mac OS X 10.6 and later, and used by all iPhoneOS versions }