diff packages/fs/rom/current/src/romfs.c @ 2474:82f8f3f7c561

* cdl/romfs.cdl: Use CYGPKG_FS_ROM_RET_DIRENT_DTYPE to control whether fatfs sets file type in romfs_fo_dirread. * src/romfs.c: Set file type in romfs_fo_dirread. * tests/romfs1.c: Test the new d_type in dirent when present.
author asl
date Thu, 01 May 2008 09:33:12 +0000
parents 04c9eb8c07e9
children 74dbf4c3f2e1
line wrap: on
line diff
--- a/packages/fs/rom/current/src/romfs.c
+++ b/packages/fs/rom/current/src/romfs.c
@@ -1077,6 +1077,9 @@ static int romfs_fo_dirread      (struct
 
     for ( i = 0 ; i < nlen && d->name[i] ; i++, nbuf++ )
 	*nbuf = d->name[i];
+#ifdef CYGPKG_FS_ROM_RET_DIRENT_DTYPE
+	ent->d_type = (((romfs_disk *)fp->f_mte->data)->node[d->node]).mode;
+#endif
 
     // A successful read. Terminate the entry name with a NUL, set the
     // residue and set the file offset to restart at the next