X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffts-cycle.c;h=13b43dbdd13c97f2dd5fa23f0883702a432dae98;hb=efc1f57b9d5d6d528919cedfe2e4c41e786341d2;hp=a0310c2e57c39394b5a25aa291ece09e771e25a6;hpb=c2546905a0f3958439581290d150c9ae4ae52a50;p=gnulib.git diff --git a/lib/fts-cycle.c b/lib/fts-cycle.c index a0310c2e5..13b43dbdd 100644 --- a/lib/fts-cycle.c +++ b/lib/fts-cycle.c @@ -18,10 +18,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "cycle-check.h" #include "hash.h" -/* Use these each of these to map a device/inode pair to an FTSENT. */ +/* Use each of these to map a device/inode pair to an FTSENT. */ struct Active_dir { dev_t dev; @@ -50,7 +54,7 @@ AD_hash (void const *x, size_t table_size) static bool setup_dir (FTS *fts) { - if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK) + if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL)) { enum { HT_INITIAL_SIZE = 31 }; fts->fts_cycle.ht = hash_initialize (HT_INITIAL_SIZE, NULL, AD_hash, @@ -74,7 +78,7 @@ setup_dir (FTS *fts) static bool enter_dir (FTS *fts, FTSENT *ent) { - if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK) + if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL)) { struct stat const *st = ent->fts_statp; struct Active_dir *ad = malloc (sizeof *ad); @@ -125,7 +129,7 @@ enter_dir (FTS *fts, FTSENT *ent) static void leave_dir (FTS *fts, FTSENT *ent) { - if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK) + if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL)) { struct stat const *st = ent->fts_statp; struct Active_dir obj; @@ -144,7 +148,7 @@ leave_dir (FTS *fts, FTSENT *ent) static void free_dir (FTS *sp) { - if (sp->fts_options & FTS_TIGHT_CYCLE_CHECK) + if (sp->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL)) { if (sp->fts_cycle.ht) hash_free (sp->fts_cycle.ht);