fts: add/use new struct member, fts_dirp
authorJim Meyering <meyering@redhat.com>
Wed, 17 Aug 2011 07:20:41 +0000 (09:20 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 19 Aug 2011 14:56:11 +0000 (16:56 +0200)
commit1062e7a84e38a0e708fa3a7de81bba8ad45a2d45
tree7f760d8ea73e7a949549e1e455c13f8e9ef28d9a
parent79a3d2d10ebf29fb4e73716ae1b72fc5d20486a5
fts: add/use new struct member, fts_dirp

We are about to use this to manage any directory with
too many entries to read all of them into memory at once.
To do that, we'll need to save the DIR* pointer in each
affected FTSENT struct.
* lib/fts_.h: Include <dirent.h>.
(struct FTSENT) [fts_dirp]: New member.
* lib/fts.c (closedir_and_clear): Define.
Use it in place of closedir so that we are sure to
clear the new fts_dirp member when done with it.
(fts_alloc): Initialize the new member.
(fts_lfree): Free, if needed.
ChangeLog
lib/fts.c
lib/fts_.h