fts: provide dirent.d_type via FTSENT.fts_statp, when possible
authorJim Meyering <meyering@redhat.com>
Fri, 28 Nov 2008 17:40:08 +0000 (18:40 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 29 Nov 2008 10:48:28 +0000 (11:48 +0100)
commit3270695f352a7ff69ba58424329ccbb0f91b47f3
tree94f6aac4e3bb7afc4b815953ae0c32180563aef5
parent19f2f429543482797a238618a51be114d6f11483
fts: provide dirent.d_type via FTSENT.fts_statp, when possible

* lib/fts.c (D_TYPE): Define.
(DT_UNKNOWN, DT_BLK, DT_CHR) [HAVE_STRUCT_DIRENT_D_TYPE]: Define.
(DT_DIR, DT_FIFO, DT_LNK, DT_REG, DT_SOCK): Likewise.
(s_ifmt_shift_bits): New function.
(set_stat_type): New function.
(fts_build): When not calling fts_stat, call set_stat_type
to propagate dirent.d_type info to fts_read caller.
* lib/fts_.h (FTSENT) [FTS_DEFER_STAT]: Mention that
fts_statp->st_mode type information may be valid.
ChangeLog
lib/fts.c
lib/fts_.h