Fixed the dirent.d_reclen calculation - define KEEP_WRONG_DIRENT_RECLEN to
enable the old and compatible behaviour (on BeOS R5, all available file systems seem to do that wrong). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@826 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
599a8de01a
commit
ba04be1db0
@ -1,7 +1,16 @@
|
|||||||
SubDir OBOS_TOP src add-ons kernel file_systems bfs ;
|
SubDir OBOS_TOP src add-ons kernel file_systems bfs ;
|
||||||
|
|
||||||
if $(DEBUG) {
|
# set some additional defines
|
||||||
local defines = [ FDefines DEBUG ] ;
|
{
|
||||||
|
local defines =
|
||||||
|
KEEP_WRONG_DIRENT_RECLEN
|
||||||
|
;
|
||||||
|
|
||||||
|
if $(DEBUG) {
|
||||||
|
defines += DEBUG ;
|
||||||
|
}
|
||||||
|
|
||||||
|
defines = [ FDefines $(defines) ] ;
|
||||||
SubDirCcFlags $(defines) ;
|
SubDirCcFlags $(defines) ;
|
||||||
SubDirC++Flags $(defines) ;
|
SubDirC++Flags $(defines) ;
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,15 @@ Equation::GetNextMatching(Volume *volume, TreeIterator *iterator,
|
|||||||
dirent->d_pdev = volume->ID();
|
dirent->d_pdev = volume->ID();
|
||||||
dirent->d_pino = volume->ToVnode(inode->Parent());
|
dirent->d_pino = volume->ToVnode(inode->Parent());
|
||||||
strcpy(dirent->d_name,inode->Name());
|
strcpy(dirent->d_name,inode->Name());
|
||||||
|
|
||||||
|
#ifdef KEEP_WRONG_DIRENT_RECLEN
|
||||||
|
// ToDo: The available file systems in BeOS apparently don't set the
|
||||||
|
// correct d_reclen - we are copying that behaviour if requested, but
|
||||||
|
// if it doesn't break compatibility, we will remove it.
|
||||||
dirent->d_reclen = strlen(dirent->d_name);
|
dirent->d_reclen = strlen(dirent->d_name);
|
||||||
|
#else
|
||||||
|
dirent->d_reclen = sizeof(struct dirent) + strlen(dirent->d_name);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
put_vnode(volume->ID(), inode->ID());
|
put_vnode(volume->ID(), inode->ID());
|
||||||
|
@ -1403,7 +1403,12 @@ bfs_read_dir(void *_ns, void *_node, void *_cookie, long *num,
|
|||||||
|
|
||||||
dirent->d_dev = volume->ID();
|
dirent->d_dev = volume->ID();
|
||||||
dirent->d_ino = id;
|
dirent->d_ino = id;
|
||||||
|
|
||||||
|
#ifdef KEEP_WRONG_DIRENT_RECLEN
|
||||||
dirent->d_reclen = length;
|
dirent->d_reclen = length;
|
||||||
|
#else
|
||||||
|
dirent->d_reclen = sizeof(struct dirent) + length;
|
||||||
|
#endif
|
||||||
|
|
||||||
*num = 1;
|
*num = 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@ -1526,7 +1531,11 @@ bfs_read_attrdir(void *_ns, void *node, void *_cookie, long *num, struct dirent
|
|||||||
Volume *volume = (Volume *)_ns;
|
Volume *volume = (Volume *)_ns;
|
||||||
|
|
||||||
dirent->d_dev = volume->ID();
|
dirent->d_dev = volume->ID();
|
||||||
|
#ifdef KEEP_WRONG_DIRENT_RECLEN
|
||||||
dirent->d_reclen = length;
|
dirent->d_reclen = length;
|
||||||
|
#else
|
||||||
|
dirent->d_reclen = sizeof(struct dirent) + length;
|
||||||
|
#endif
|
||||||
|
|
||||||
*num = 1;
|
*num = 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user